Search in sources :

Example 6 with ToolResult

use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.

the class SetGetEntireSSTableStreamThroughputTest method assertSetGetValidThroughput.

private static void assertSetGetValidThroughput(int throughput) {
    ToolResult tool = invokeNodetool("setstreamthroughput", "-e", String.valueOf(throughput));
    tool.assertOnCleanExit();
    assertThat(tool.getStdout()).isEmpty();
    assertGetThroughput(throughput);
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult)

Example 7 with ToolResult

use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.

the class StandaloneVerifierTest method testQuickArg.

@Test
public void testQuickArg() {
    Arrays.asList("-q", "--quick").forEach(arg -> {
        ToolResult tool = ToolRunner.invokeClass(StandaloneVerifier.class, arg, "system_schema", "tables");
        assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("quick=true"));
        Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
        assertCorrectEnvPostTest();
        tool.assertOnCleanExit();
    });
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 8 with ToolResult

use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.

the class StandaloneVerifierTest method testRepairStatusArg.

@Test
public void testRepairStatusArg() {
    Arrays.asList("-r", "--mutate_repair_status").forEach(arg -> {
        ToolResult tool = ToolRunner.invokeClass(StandaloneVerifier.class, arg, "system_schema", "tables");
        assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("mutateRepairStatus=true"));
        Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
        assertCorrectEnvPostTest();
        tool.assertOnCleanExit();
    });
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 9 with ToolResult

use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.

the class StandaloneVerifierTest method testDefaultCall.

@Test
public void testDefaultCall() {
    ToolResult tool = ToolRunner.invokeClass(StandaloneVerifier.class, "system_schema", "tables");
    assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("using the following options"));
    Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
    assertEquals(0, tool.getExitCode());
    assertCorrectEnvPostTest();
    tool.assertOnCleanExit();
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 10 with ToolResult

use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.

the class StandaloneVerifierTest method testExtendedArg.

@Test
public void testExtendedArg() {
    Arrays.asList("-e", "--extended").forEach(arg -> {
        ToolResult tool = ToolRunner.invokeClass(StandaloneVerifier.class, arg, "system_schema", "tables");
        assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("extended=true"));
        Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
        assertCorrectEnvPostTest();
        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