/** * A non-concurrent version testing both create and destroy. */ public void test_KBCreateAndDestroy() throws Exception { final String namespace = getName(); // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); // KB does not exist. assertKBNotFound(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace, properties)).get(); // Attempt to discover the KB instance. assertKBExists(jnl, namespace); // Destroy the KB instance. AbstractApiTask.submitApiTask(jnl, new DestroyKBTask(namespace)).get(); // Verify gone. assertKBNotFound(jnl, namespace); } finally { if (jnl != null) jnl.destroy(); } }
assertKBNotFound(jnl, namespace); assertKBNotFound(jnl, namespace);
assertKBNotFound(jnl, namespace); assertKBNotFound(jnl, namespace);
assertKBNotFound(jnl, namespace); assertKBNotFound(jnl, namespace);
/** * A non-concurrent version, just to make sure that the basic logic works. */ public void test_KBCreateAndDiscovery() throws Exception { final String namespace = getName(); // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); // KB does not exist. assertKBNotFound(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace, properties)).get(); // Attempt to discover the KB instance. assertKBExists(jnl, namespace); } finally { if (jnl != null) jnl.destroy(); } }
/** * A non-concurrent version with two KBs. */ public void test_2KBCreateAndDiscovery() throws Exception { final String namespace = getName(); final String namespace2 = getName()+"2"; // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); // KB does not exist. assertKBNotFound(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace, properties)).get(); assertKBExists(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace2, properties)).get(); assertKBExists(jnl, namespace2); } finally { if (jnl != null) jnl.destroy(); } }
/** * A non-concurrent version testing both create and destroy. */ public void test_KBCreateAndDestroy() throws Exception { final String namespace = getName(); // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); // KB does not exist. assertKBNotFound(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace, properties)).get(); // Attempt to discover the KB instance. assertKBExists(jnl, namespace); // Destroy the KB instance. AbstractApiTask.submitApiTask(jnl, new DestroyKBTask(namespace)).get(); // Verify gone. assertKBNotFound(jnl, namespace); } finally { if (jnl != null) jnl.destroy(); } }
assertKBNotFound(jnl, namespace); assertKBNotFound(jnl, namespace);
assertKBNotFound(jnl, namespace); assertKBNotFound(jnl, namespace);
assertKBNotFound(jnl, namespace); assertKBNotFound(jnl, namespace);
/** * A non-concurrent version, just to make sure that the basic logic works. */ public void test_KBCreateAndDiscovery() throws Exception { final String namespace = getName(); // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); // KB does not exist. assertKBNotFound(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace, properties)).get(); // Attempt to discover the KB instance. assertKBExists(jnl, namespace); } finally { if (jnl != null) jnl.destroy(); } }
/** * A non-concurrent version with two KBs. */ public void test_2KBCreateAndDiscovery() throws Exception { final String namespace = getName(); final String namespace2 = getName()+"2"; // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); // KB does not exist. assertKBNotFound(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace, properties)).get(); assertKBExists(jnl, namespace); // Create the KB instance. AbstractApiTask.submitApiTask(jnl, new CreateKBTask(namespace2, properties)).get(); assertKBExists(jnl, namespace2); } finally { if (jnl != null) jnl.destroy(); } }