This is an automated email from the ASF dual-hosted git repository.
sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new bacd4c1 [TABLE SERVICE] Fix ZkClusterMetadataStoreTest
bacd4c1 is described below
commit bacd4c12debdeeeeb30eec7666fcadee037cfc08
Author: Sijie Guo <[email protected]>
AuthorDate: Sun Jun 10 12:13:50 2018 -0700
[TABLE SERVICE] Fix ZkClusterMetadataStoreTest
Descriptions of the changes in this PR:
### Motivation
initialize signature was changed. but the test was not changed.
### Changes
Fix the test case.
Author: Sijie Guo <[email protected]>
Reviewers: Enrico Olivelli <[email protected]>, Jia Zhai <None>
This closes #1506 from sijie/fix_zk_cluster_initialize
---
.../storage/impl/cluster/ZkClusterMetadataStoreTest.java | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
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 e6ca0ba..62dfe1e 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 class ZkClusterMetadataStoreTest extends
ZooKeeperClusterTestCase {
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 class ZkClusterMetadataStoreTest extends
ZooKeeperClusterTestCase {
@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
--
To stop receiving notification emails like this one, please contact
[email protected].