use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class StandaloneSplitterTest method testWrongArgFailsAndPrintsHelp.
@Test
public void testWrongArgFailsAndPrintsHelp() {
ToolResult tool = ToolRunner.invokeClass(StandaloneSplitter.class, "--debugwrong", "mockFile");
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
assertThat(tool.getCleanedStderr(), CoreMatchers.containsStringIgnoringCase("Unrecognized option"));
assertEquals(1, tool.getExitCode());
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SetGetEntireSSTableInterDCStreamThroughputTest method assertGetThroughput.
private static void assertGetThroughput(int expected) {
ToolResult tool = invokeNodetool("getinterdcstreamthroughput", "-e");
tool.assertOnCleanExit();
if (expected > 0)
assertThat(tool.getStdout()).contains("Current entire SSTable inter-datacenter stream throughput: " + expected + " MiB/s");
else
assertThat(tool.getStdout()).contains("Current entire SSTable inter-datacenter stream throughput: unlimited");
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class AuditLogViewerTest method testNoArgs.
@Test
public void testNoArgs() {
ToolResult tool = ToolRunner.invoke(toolPath);
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
assertThat(tool.getCleanedStderr(), CoreMatchers.containsStringIgnoringCase("Audit log files directory path is a required argument."));
assertEquals(1, tool.getExitCode());
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class CompactionStressTest method testWriteAndCompact.
@Test
public void testWriteAndCompact() {
ClassLoader classLoader = getClass().getClassLoader();
File file = new File(classLoader.getResource("blogpost.yaml").getFile());
String profileFile = file.absolutePath();
ToolResult tool = ToolRunner.invokeClass("org.apache.cassandra.stress.CompactionStress", "write", "-d", "build/test/cassandra", "-g", "0", "-p", profileFile, "-t", "4");
tool.assertOnCleanExit();
tool = ToolRunner.invokeClass("org.apache.cassandra.stress.CompactionStress", "compact", "-d", "build/test/cassandra", "-p", profileFile, "-t", "4");
tool.assertOnCleanExit();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableLevelResetterTest method testMissingSecurityFlagCall.
@Test
public void testMissingSecurityFlagCall() {
ToolResult tool = ToolRunner.invokeClass(SSTableLevelResetter.class, "system_schema", "tables");
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
assertEquals(1, tool.getExitCode());
assertCorrectEnvPostTest();
}
Aggregations