You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/06/10 19:14:02 UTC

[GitHub] sijie closed pull request #1506: [table service] Fix ZkClusterMetadataStoreTest

sijie closed pull request #1506: [table service] Fix ZkClusterMetadataStoreTest
URL: https://github.com/apache/bookkeeper/pull/1506
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java
index e6ca0ba92..62dfe1eab 100644
--- a/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java
+++ b/stream/storage/impl/src/test/java/org/apache/bookkeeper/stream/storage/impl/cluster/ZkClusterMetadataStoreTest.java
@@ -19,6 +19,7 @@
 package org.apache.bookkeeper.stream.storage.impl.cluster;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -67,7 +68,7 @@ public void setup() {
             new ExponentialBackoffRetry(200, 10, 5000));
         curatorClient.start();
         store = new ZkClusterMetadataStore(curatorClient, zkServers, "/" + runtime.getMethodName());
-        store.initializeCluster(NUM_STORAGE_CONTAINERS);
+        assertTrue(store.initializeCluster(NUM_STORAGE_CONTAINERS));
     }
 
     @After
@@ -107,14 +108,7 @@ public void testUnitialized() {
     @Test
     public void testInitialize() {
         int numStorageContainers = 2048;
-        try {
-            store.initializeCluster(numStorageContainers);
-            fail("Should fail to initialize cluster if already initialized");
-        } catch (StorageRuntimeException sre) {
-            assertTrue(sre.getCause() instanceof KeeperException);
-            KeeperException cause = (KeeperException) sre.getCause();
-            assertEquals(Code.NODEEXISTS, cause.code());
-        }
+        assertFalse(store.initializeCluster(numStorageContainers));
     }
 
     @Test


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services