Repository: incubator-slider
Updated Branches:
  refs/heads/develop ad9a8bfe2 -> 3f1d672a3


SLIDER-1129 add newline to response body to fix unit test


Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/3f1d672a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/3f1d672a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/3f1d672a

Branch: refs/heads/develop
Commit: 3f1d672a317682138cfd9527819bda99a82fea45
Parents: ad9a8bf
Author: Gour Saha <gourks...@apache.org>
Authored: Thu Jul 28 11:55:09 2016 -0700
Committer: Gour Saha <gourks...@apache.org>
Committed: Thu Jul 28 11:55:09 2016 -0700

----------------------------------------------------------------------
 .../org/apache/slider/test/SliderTestUtils.groovy  | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3f1d672a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
----------------------------------------------------------------------
diff --git 
a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy 
b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
index eac8a14..2a02907 100644
--- a/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
+++ b/slider-core/src/test/groovy/org/apache/slider/test/SliderTestUtils.groovy
@@ -514,15 +514,13 @@ class SliderTestUtils extends Assert {
     try {
       conn.connect()
       int resultCode = conn.getResponseCode()
-      if (resultCode != 200) {
-        log.warn("Result code of $resultCode")
-      }
+      log.info("Result code of $resultCode")
       reader = new BufferedReader(new InputStreamReader(conn.getInputStream()))
       String inputLine;
       response = new StringBuffer();
   
       while ((inputLine = reader.readLine()) != null) {
-        response.append(inputLine);
+        response.append("$inputLine\n");
       }
     } catch (IOException e) {
       log.error("Failed on $url: $e", e)
@@ -533,7 +531,9 @@ class SliderTestUtils extends Assert {
       }
     }
 
-    return response.toString();
+    String responseBody = response.toString()
+    log.info("Response body:\n$responseBody")
+    return responseBody;
   }
 
   /**
@@ -568,15 +568,13 @@ class SliderTestUtils extends Assert {
     try {
       conn.connect()
       resultCode = conn.getResponseCode()
-      if (resultCode != 200) {
-        log.warn("Result code of $resultCode")
-      }
+      log.info("Result code of $resultCode")
       reader = new BufferedReader(new InputStreamReader(conn.getInputStream()))
       String inputLine;
       response = new StringBuffer();
   
       while ((inputLine = reader.readLine()) != null) {
-        response.append(inputLine);
+        response.append("$inputLine\n");
       }
     } catch (IOException e) {
       throw NetUtils.wrapException(url, destURL.getPort(), "localhost", 0, e)
@@ -588,6 +586,7 @@ class SliderTestUtils extends Assert {
 
     def body = response.toString()
     uprateFaults("GET", url, resultCode, body)
+    log.info("Response body:\n$body")
     return body;
   }
 

Reply via email to