Search in sources :

Example 46 with ToolResult

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();
}
Also used : NoHostAvailableException(com.datastax.driver.core.exceptions.NoHostAvailableException) ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 47 with ToolResult

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();
}
Also used : NoHostAvailableException(com.datastax.driver.core.exceptions.NoHostAvailableException) ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 48 with ToolResult

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();
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 49 with ToolResult

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();
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 50 with ToolResult

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();
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Aggregations

ToolResult (org.apache.cassandra.tools.ToolRunner.ToolResult)123 Test (org.junit.Test)102 File (org.apache.cassandra.io.util.File)4 NoHostAvailableException (com.datastax.driver.core.exceptions.NoHostAvailableException)3 RandomAccessFile (java.io.RandomAccessFile)3 LegacySSTableTest (org.apache.cassandra.io.sstable.LegacySSTableTest)3 SSTableReader (org.apache.cassandra.io.sstable.format.SSTableReader)2 Session (com.datastax.driver.core.Session)1 File (java.io.File)1 ArrayList (java.util.ArrayList)1 ColumnFamilyStore (org.apache.cassandra.db.ColumnFamilyStore)1 Keyspace (org.apache.cassandra.db.Keyspace)1 Cluster (org.apache.cassandra.distributed.Cluster)1 IInvokableInstance (org.apache.cassandra.distributed.api.IInvokableInstance)1 Ignore (org.junit.Ignore)1