/** * Basic test of the concurrent create and discovery of a KB. */ public void test_concurrentKBCreateAndDiscovery() 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); doConcurrentCreateAndDiscoveryTest(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(); } }
/** * Runs the concurrent KB Create and Discovery test multiple times against a * single journal, but using a distinct KB namespace for each test. * <p> * Note: This does not attempt to create the distinct KBs concurrently. */ public void test_concurrentKBCreateAndDiscoveryStressTestOnSharedJournal() throws Exception { // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); for (int i = 0; i < 100; i++) { final String namespace = getName() + "-" + i; doConcurrentCreateAndDiscoveryTest(jnl, namespace); } } finally { if (jnl != null) jnl.destroy(); } }
final String namespace = getName();
/** * 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(); } }
final String namespace = getName();
final String namespace = getName();
/** * 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(); } }
/** * Basic test of the concurrent create and discovery of a KB. */ public void test_concurrentKBCreateAndDiscovery() 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); doConcurrentCreateAndDiscoveryTest(jnl, namespace); } finally { if (jnl != null) jnl.destroy(); } }
/** * Runs the concurrent KB Create and Discovery test multiple times against a * single journal, but using a distinct KB namespace for each test. * <p> * Note: This does not attempt to create the distinct KBs concurrently. */ public void test_concurrentKBCreateAndDiscoveryStressTestOnSharedJournal() throws Exception { // Inherit the properties from the delegate. final Properties properties = getProperties(); Journal jnl = null; try { // New Journal instance. jnl = new Journal(properties); for (int i = 0; i < 100; i++) { final String namespace = getName() + "-" + i; doConcurrentCreateAndDiscoveryTest(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(); } }
final String namespace = getName();
final String namespace = getName();
/** * 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(); } }
final String namespace = getName();
/** * 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(); } }