knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject git commit: Fix broken test.
Date Wed, 21 Aug 2013 14:55:48 GMT
Updated Branches:
  refs/heads/master b16e33261 -> f69420ecc


Fix broken test.


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

Branch: refs/heads/master
Commit: f69420eccf0e80b783bee296591c5ab11a2611a8
Parents: b16e332
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Wed Aug 21 10:55:30 2013 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Wed Aug 21 10:55:30 2013 -0400

----------------------------------------------------------------------
 build.xml                                           |  2 +-
 .../gateway/dispatch/HttpClientDispatchTest.java    | 16 +++++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/f69420ec/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 58da8b0..d31fa77 100644
--- a/build.xml
+++ b/build.xml
@@ -23,7 +23,7 @@
 
     <property name="gateway-name" value="Apache Knox (Incubator)"/>
     <property name="gateway-project" value="knox"/>
-    <property name="gateway-artifact" value="knox-incubator"/>
+    <property name="gateway-artifact" value="knox-incubating"/>
     <property name="gateway-version" value="0.3.0-SNAPSHOT"/>
     <property name="release-manager" value="kminder"/>
 

http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/f69420ec/gateway-server/src/test/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatchTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatchTest.java
b/gateway-server/src/test/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatchTest.java
index 331d46a..06daef1 100644
--- a/gateway-server/src/test/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatchTest.java
+++ b/gateway-server/src/test/java/org/apache/hadoop/gateway/dispatch/HttpClientDispatchTest.java
@@ -20,8 +20,11 @@ package org.apache.hadoop.gateway.dispatch;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.params.BasicHttpParams;
 import org.easymock.EasyMock;
+import org.easymock.IAnswer;
+import org.eclipse.jetty.server.HttpOutput;
 import org.junit.Test;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -40,7 +43,7 @@ public class HttpClientDispatchTest {
 
   // Make sure Hadoop cluster topology isn't exposed to client when there is a connectivity
issue.
   @Test
-  public void testJiraKnox58() throws URISyntaxException {
+  public void testJiraKnox58() throws URISyntaxException, IOException {
 
     URI uri = new URI( "http://unreachable-host" );
     BasicHttpParams params = new BasicHttpParams();
@@ -53,6 +56,17 @@ public class HttpClientDispatchTest {
     HttpServletRequest inboundRequest = EasyMock.createNiceMock( HttpServletRequest.class
);
 
     HttpServletResponse outboundResponse = EasyMock.createNiceMock( HttpServletResponse.class
);
+    EasyMock.expect( outboundResponse.getOutputStream() ).andAnswer( new IAnswer<ServletOutputStream>()
{
+      @Override
+      public ServletOutputStream answer() throws Throwable {
+        return new ServletOutputStream() {
+          @Override
+          public void write( int b ) throws IOException {
+            throw new IOException( "unreachable-host" );
+          }
+        };
+      }
+    });
 
     EasyMock.replay( outboundRequest, inboundRequest, outboundResponse );
 


Mime
View raw message