use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class BulkLoaderTest method testBulkLoader_WithArgs1.
@Test
public void testBulkLoader_WithArgs1() throws Exception {
ToolResult tool = ToolRunner.invokeClass(BulkLoader.class, "-d", "127.9.9.1", "--port", "9042", OfflineToolUtils.sstableDirName("legacy_sstables", "legacy_ma_simple"));
assertEquals(-1, tool.getExitCode());
if (!(tool.getException().getCause() instanceof BulkLoadException))
throw tool.getException();
if (!(tool.getException().getCause().getCause() instanceof NoHostAvailableException))
throw tool.getException();
assertNoUnexpectedThreadsStarted(new String[] { "ObjectCleanerThread", "globalEventExecutor-[1-9]-[1-9]", "globalEventExecutor-[1-9]-[1-9]", "Shutdown-checker", "cluster[0-9]-connection-reaper-[0-9]" });
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class BulkLoaderTest method testBulkLoader_WithArgs2.
@Test
public void testBulkLoader_WithArgs2() throws Exception {
ToolResult tool = ToolRunner.invokeClass(BulkLoader.class, "-d", "127.9.9.1:9042", "--port", "9041", OfflineToolUtils.sstableDirName("legacy_sstables", "legacy_ma_simple"));
assertEquals(-1, tool.getExitCode());
if (!(tool.getException().getCause() instanceof BulkLoadException))
throw tool.getException();
if (!(tool.getException().getCause().getCause() instanceof NoHostAvailableException))
throw tool.getException();
assertNoUnexpectedThreadsStarted(new String[] { "ObjectCleanerThread", "globalEventExecutor-[1-9]-[1-9]", "globalEventExecutor-[1-9]-[1-9]", "Shutdown-checker", "cluster[0-9]-connection-reaper-[0-9]" });
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class BulkLoaderTest method testBulkLoader_WithArgs4.
@Test(expected = NoHostAvailableException.class)
public void testBulkLoader_WithArgs4() throws Throwable {
ToolResult tool = ToolRunner.invokeClass(BulkLoader.class, "-d", "127.9.9.1:9041", OfflineToolUtils.sstableDirName("legacy_sstables", "legacy_ma_simple"));
assertEquals(-1, tool.getExitCode());
throw tool.getException().getCause().getCause();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class BulkLoaderTest method testBulkLoader_WithArgs3.
@Test(expected = NoHostAvailableException.class)
public void testBulkLoader_WithArgs3() throws Throwable {
ToolResult tool = ToolRunner.invokeClass(BulkLoader.class, "-d", "127.9.9.1", "--port", "9041", OfflineToolUtils.sstableDirName("legacy_sstables", "legacy_ma_simple"));
assertEquals(-1, tool.getExitCode());
throw tool.getException().getCause().getCause();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class CompactionStressTest method testNoArgs.
@Test
public void testNoArgs() {
ToolResult tool = ToolRunner.invokeClass("org.apache.cassandra.stress.CompactionStress");
tool.assertOnCleanExit();
}
Aggregations