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 2014/01/25 01:14:44 UTC

[3/7] git commit: Updated http tests in libprocess for the new get/post interfaces.

Updated http tests in libprocess for the new get/post interfaces.

From: Jie Yu <yu...@gmail.com>
Review: https://reviews.apache.org/r/17077


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

Branch: refs/heads/master
Commit: b8a0dd30a83c64225f65f7916506da721a7c389d
Parents: 170b854
Author: Benjamin Hindman <be...@gmail.com>
Authored: Sat Jan 18 10:23:26 2014 -0800
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Fri Jan 24 16:14:01 2014 -0800

----------------------------------------------------------------------
 3rdparty/libprocess/src/tests/http_tests.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/b8a0dd30/3rdparty/libprocess/src/tests/http_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/http_tests.cpp b/3rdparty/libprocess/src/tests/http_tests.cpp
index c27e027..62ab64d 100644
--- a/3rdparty/libprocess/src/tests/http_tests.cpp
+++ b/3rdparty/libprocess/src/tests/http_tests.cpp
@@ -231,7 +231,7 @@ TEST(HTTP, Get)
     .WillOnce(Invoke(validateGetWithQuery));
 
   Future<http::Response> queryFuture =
-    http::get(process.self(), "get", Some("foo=bar#frag"));
+    http::get(process.self(), "get", "foo=bar#frag");
 
   AWAIT_READY(queryFuture);
   ASSERT_EQ(http::statuses[200], queryFuture.get().status);
@@ -261,11 +261,17 @@ TEST(HTTP, Post)
 
   spawn(process);
 
+  // Test the case where there is a content type but no body.
+  Future<http::Response> future =
+    http::post(process.self(), "post", None(), "text/plain");
+
+  AWAIT_EXPECT_FAILED(future);
+
   EXPECT_CALL(process, post(_))
     .WillOnce(Invoke(validatePost));
 
-  Future<http::Response> future =
-    http::post(process.self(), "post", "text/plain", "This is the payload.");
+  future =
+    http::post(process.self(), "post", "This is the payload.", "text/plain");
 
   AWAIT_READY(future);
   ASSERT_EQ(http::statuses[200], future.get().status);