You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2015/07/30 15:12:47 UTC

mesos git commit: Factored out the pattern for URL generation in a fetcher test.

Repository: mesos
Updated Branches:
  refs/heads/master 6983cebf7 -> 2e4829221


Factored out the pattern for URL generation in a fetcher test.

Review: https://reviews.apache.org/r/36501


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/2e482922
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/2e482922
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/2e482922

Branch: refs/heads/master
Commit: 2e4829221cbcb23e711285ac4dcad3d2409793cc
Parents: 6983ceb
Author: Klaus Ma <kl...@cguru.net>
Authored: Thu Jul 30 14:52:55 2015 +0200
Committer: Bernd Mathiske <be...@mesosphere.io>
Committed: Thu Jul 30 15:00:17 2015 +0200

----------------------------------------------------------------------
 src/tests/fetcher_tests.cpp | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/2e482922/src/tests/fetcher_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fetcher_tests.cpp b/src/tests/fetcher_tests.cpp
index e2a52f7..3ded3c0 100644
--- a/src/tests/fetcher_tests.cpp
+++ b/src/tests/fetcher_tests.cpp
@@ -291,9 +291,13 @@ TEST_F(FetcherTest, OSNetUriTest)
 
   spawn(process);
 
-  string url = "http://" + net::getHostname(process.self().address.ip).get() +
-               ":" + stringify(process.self().address.port) +
-               "/" + process.self().id + "/test";
+  const network::Address& address = process.self().address;
+
+  process::http::URL url(
+      "http",
+      address.ip,
+      address.port,
+      path::join(process.self().id, "test"));
 
   string localFile = path::join(os::getcwd(), "test");
   EXPECT_FALSE(os::exists(localFile));
@@ -307,7 +311,7 @@ TEST_F(FetcherTest, OSNetUriTest)
 
   CommandInfo commandInfo;
   CommandInfo::URI* uri = commandInfo.add_uris();
-  uri->set_value(url);
+  uri->set_value(stringify(url));
 
   Fetcher fetcher;
   SlaveID slaveId;