knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [03/16] knox git commit: KNOX-1104 - Test to verify behavior of HaProvider service with only a single URL ( Phil Zampino via Sandeep More)
Date Mon, 13 Nov 2017 15:47:53 GMT
KNOX-1104 - Test to verify behavior of HaProvider service with only a single URL ( Phil Zampino
via Sandeep More)


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

Branch: refs/heads/KNOX-998-Package_Restructuring
Commit: 7f58a165f1af9fb7ab45169f5e58b858fdc9c682
Parents: 67ad3e3
Author: Sandeep More <more@apache.org>
Authored: Sun Nov 5 15:26:46 2017 -0500
Committer: Sandeep More <more@apache.org>
Committed: Sun Nov 5 15:26:46 2017 -0500

----------------------------------------------------------------------
 .../ha/provider/impl/DefaultURLManagerTest.java  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/7f58a165/gateway-provider-ha/src/test/java/org/apache/hadoop/gateway/ha/provider/impl/DefaultURLManagerTest.java
----------------------------------------------------------------------
diff --git a/gateway-provider-ha/src/test/java/org/apache/hadoop/gateway/ha/provider/impl/DefaultURLManagerTest.java
b/gateway-provider-ha/src/test/java/org/apache/hadoop/gateway/ha/provider/impl/DefaultURLManagerTest.java
index 6c07d23..619abbc 100644
--- a/gateway-provider-ha/src/test/java/org/apache/hadoop/gateway/ha/provider/impl/DefaultURLManagerTest.java
+++ b/gateway-provider-ha/src/test/java/org/apache/hadoop/gateway/ha/provider/impl/DefaultURLManagerTest.java
@@ -43,6 +43,25 @@ public class DefaultURLManagerTest {
       assertEquals(url1, manager.getActiveURL());
    }
 
+   /**
+    * KNOX-1104
+    * Verify that a service with HaProvider configuration, but only a single URL does not
break the HaProvider.
+    */
+   @Test
+   public void testSingleURLManagement() {
+      ArrayList<String> urls = new ArrayList<>();
+      String url1 = "http://host1";
+      urls.add(url1);
+      DefaultURLManager manager = new DefaultURLManager();
+      manager.setURLs(urls);
+      assertTrue(manager.getURLs().containsAll(urls));
+      assertEquals(url1, manager.getActiveURL());
+      manager.markFailed(url1);
+      assertEquals(url1, manager.getActiveURL());
+      manager.markFailed(url1);
+      assertEquals(url1, manager.getActiveURL());
+   }
+
    @Test
    public void testMarkingFailedURL() {
       ArrayList<String> urls = new ArrayList<>();


Mime
View raw message