knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject knox git commit: KNOX-503 - Tests which include expected unreachable hosts fail with wildcard DNS records (Kristopher Kane, Kevin Risden)
Date Mon, 10 Dec 2018 19:43:16 GMT
Repository: knox
Updated Branches:
  refs/heads/master 671a6659e -> c478a0629


KNOX-503 - Tests which include expected unreachable hosts fail with wildcard DNS records (Kristopher
Kane, Kevin Risden)

Signed-off-by: Kevin Risden <krisden@apache.org>


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

Branch: refs/heads/master
Commit: c478a0629e6017a68f1c831b0f838b4c1b8cea40
Parents: 671a665
Author: Kevin Risden <krisden@apache.org>
Authored: Mon Dec 10 13:59:57 2018 -0500
Committer: Kevin Risden <krisden@apache.org>
Committed: Mon Dec 10 14:42:48 2018 -0500

----------------------------------------------------------------------
 .../gateway/ha/dispatch/DefaultHaDispatchTest.java    |  6 +++---
 .../org/apache/knox/gateway/AuditLoggingTest.java     |  2 +-
 .../knox/gateway/rm/dispatch/RMHaDispatchTest.java    | 14 +++++++-------
 .../gateway/hdfs/dispatch/WebHdfsHaDispatchTest.java  |  6 +++---
 .../knox/gateway/dispatch/DefaultDispatchTest.java    |  6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/c478a062/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
----------------------------------------------------------------------
diff --git a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
index 85d4edd..3fe41d8 100644
--- a/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
+++ b/gateway-provider-ha/src/test/java/org/apache/knox/gateway/ha/dispatch/DefaultHaDispatchTest.java
@@ -50,8 +50,8 @@ public class DefaultHaDispatchTest {
     HaDescriptor descriptor = HaDescriptorFactory.createDescriptor();
     descriptor.addServiceConfig(HaDescriptorFactory.createServiceConfig(serviceName, "true",
"1", "1000", "2", "1000", null, null));
     HaProvider provider = new DefaultHaProvider(descriptor);
-    URI uri1 = new URI( "http://unreachable-host" );
-    URI uri2 = new URI( "http://reachable-host" );
+    URI uri1 = new URI( "http://unreachable-host.invalid" );
+    URI uri2 = new URI( "http://reachable-host.invalid" );
     ArrayList<String> urlList = new ArrayList<>();
     urlList.add(uri1.toString());
     urlList.add(uri2.toString());
@@ -81,7 +81,7 @@ public class DefaultHaDispatchTest {
         return new SynchronousServletOutputStreamAdapter() {
           @Override
           public void write( int b ) throws IOException {
-            throw new IOException( "unreachable-host" );
+            throw new IOException( "unreachable-host.invalid" );
           }
         };
       }

http://git-wip-us.apache.org/repos/asf/knox/blob/c478a062/gateway-server/src/test/java/org/apache/knox/gateway/AuditLoggingTest.java
----------------------------------------------------------------------
diff --git a/gateway-server/src/test/java/org/apache/knox/gateway/AuditLoggingTest.java b/gateway-server/src/test/java/org/apache/knox/gateway/AuditLoggingTest.java
index e324902..affd47d 100644
--- a/gateway-server/src/test/java/org/apache/knox/gateway/AuditLoggingTest.java
+++ b/gateway-server/src/test/java/org/apache/knox/gateway/AuditLoggingTest.java
@@ -228,7 +228,7 @@ public class AuditLoggingTest {
   @Test
   public void testHttpClientOutboundException() throws IOException,
       URISyntaxException {
-    String uri = "http://outbound-host:port/path";
+    String uri = "http://outbound-host.invalid:port/path";
 
     HttpServletRequest inboundRequest = EasyMock.createNiceMock( HttpServletRequest.class
);
     EasyMock.expect( inboundRequest.getHeaderNames() ).andReturn( Collections.enumeration(new
ArrayList<>() ) ).anyTimes();

http://git-wip-us.apache.org/repos/asf/knox/blob/c478a062/gateway-service-rm/src/test/java/org/apache/knox/gateway/rm/dispatch/RMHaDispatchTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-rm/src/test/java/org/apache/knox/gateway/rm/dispatch/RMHaDispatchTest.java
b/gateway-service-rm/src/test/java/org/apache/knox/gateway/rm/dispatch/RMHaDispatchTest.java
index 2ca4360..132bce2 100644
--- a/gateway-service-rm/src/test/java/org/apache/knox/gateway/rm/dispatch/RMHaDispatchTest.java
+++ b/gateway-service-rm/src/test/java/org/apache/knox/gateway/rm/dispatch/RMHaDispatchTest.java
@@ -60,8 +60,8 @@ public class RMHaDispatchTest {
         HaDescriptor descriptor = HaDescriptorFactory.createDescriptor();
         descriptor.addServiceConfig(HaDescriptorFactory.createServiceConfig(serviceName,
"true", "1", "1000", "2", "1000", null, null));
         HaProvider provider = new DefaultHaProvider(descriptor);
-        URI uri1 = new URI("http://unreachable-host");
-        URI uri2 = new URI("http://reachable-host");
+        URI uri1 = new URI("http://unreachable-host.invalid");
+        URI uri2 = new URI("http://reachable-host.invalid");
         ArrayList<String> urlList = new ArrayList<>();
         urlList.add(uri1.toString());
         urlList.add(uri2.toString());
@@ -91,7 +91,7 @@ public class RMHaDispatchTest {
                 return new ServletOutputStream() {
                     @Override
                     public void write(int b) throws IOException {
-                        throw new IOException("unreachable-host");
+                        throw new IOException("unreachable-host.invalid");
                     }
 
                     @Override
@@ -131,9 +131,9 @@ public class RMHaDispatchTest {
         HaDescriptor descriptor = HaDescriptorFactory.createDescriptor();
         descriptor.addServiceConfig(HaDescriptorFactory.createServiceConfig(serviceName,
"true", "1", "1000", "2", "1000", null, null));
         HaProvider provider = new DefaultHaProvider(descriptor);
-        URI uri1 = new URI("http://passive-host");
-        URI uri2 = new URI("http://other-host");
-        URI uri3 = new URI("http://active-host");
+        URI uri1 = new URI("http://passive-host.invalid");
+        URI uri2 = new URI("http://other-host.invalid");
+        URI uri3 = new URI("http://active-host.invalid");
         ArrayList<String> urlList = new ArrayList<>();
         urlList.add(uri1.toString());
         urlList.add(uri2.toString());
@@ -170,7 +170,7 @@ public class RMHaDispatchTest {
                 return new ServletOutputStream() {
                     @Override
                     public void write(int b) throws IOException {
-                        throw new IOException("unreachable-host");
+                        throw new IOException("unreachable-host.invalid");
                     }
 
                     @Override

http://git-wip-us.apache.org/repos/asf/knox/blob/c478a062/gateway-service-webhdfs/src/test/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatchTest.java
----------------------------------------------------------------------
diff --git a/gateway-service-webhdfs/src/test/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatchTest.java
b/gateway-service-webhdfs/src/test/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatchTest.java
index 7d2afad..03feaf3 100644
--- a/gateway-service-webhdfs/src/test/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatchTest.java
+++ b/gateway-service-webhdfs/src/test/java/org/apache/knox/gateway/hdfs/dispatch/WebHdfsHaDispatchTest.java
@@ -50,8 +50,8 @@ public class WebHdfsHaDispatchTest {
       HaDescriptor descriptor = HaDescriptorFactory.createDescriptor();
       descriptor.addServiceConfig(HaDescriptorFactory.createServiceConfig(serviceName, "true",
"1", "1000", "2", "1000", null, null));
       HaProvider provider = new DefaultHaProvider(descriptor);
-      URI uri1 = new URI( "http://unreachable-host" );
-      URI uri2 = new URI( "http://reachable-host" );
+      URI uri1 = new URI( "http://unreachable-host.invalid" );
+      URI uri2 = new URI( "http://reachable-host.invalid" );
       ArrayList<String> urlList = new ArrayList<>();
       urlList.add(uri1.toString());
       urlList.add(uri2.toString());
@@ -81,7 +81,7 @@ public class WebHdfsHaDispatchTest {
             return new SynchronousServletOutputStreamAdapter() {
                @Override
                public void write( int b ) throws IOException {
-                  throw new IOException( "unreachable-host" );
+                  throw new IOException( "unreachable-host.invalid" );
                }
             };
          }

http://git-wip-us.apache.org/repos/asf/knox/blob/c478a062/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
index a164295..a211232 100644
--- a/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
+++ b/gateway-spi/src/test/java/org/apache/knox/gateway/dispatch/DefaultDispatchTest.java
@@ -62,7 +62,7 @@ public class DefaultDispatchTest {
   @Test
   public void testJiraKnox58() throws URISyntaxException, IOException {
 
-    URI uri = new URI( "http://unreachable-host" );
+    URI uri = new URI( "http://unreachable-host.invalid" );
     BasicHttpParams params = new BasicHttpParams();
 
     HttpUriRequest outboundRequest = EasyMock.createNiceMock( HttpUriRequest.class );
@@ -84,7 +84,7 @@ public class DefaultDispatchTest {
         return new SynchronousServletOutputStreamAdapter() {
           @Override
           public void write( int b ) throws IOException {
-            throw new IOException( "unreachable-host" );
+            throw new IOException( "unreachable-host.invalid" );
           }
         };
       }
@@ -100,7 +100,7 @@ public class DefaultDispatchTest {
       dispatch.executeRequest( outboundRequest, inboundRequest, outboundResponse );
       fail( "Should have thrown IOException" );
     } catch( IOException e ) {
-      assertThat( e.getMessage(), not( containsString( "unreachable-host" ) ) );
+      assertThat( e.getMessage(), not( containsString( "unreachable-host.invalid" ) ) );
       assertThat( e, not( instanceOf( UnknownHostException.class ) ) ) ;
       assertThat( "Message needs meaningful content.", e.getMessage().trim().length(), greaterThan(
12 ) );
     }


Mime
View raw message