use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableExpiredBlockersTest method testWrongArgsIgnored.
@Test
public void testWrongArgsIgnored() {
ToolResult tool = ToolRunner.invokeClass(SSTableExpiredBlockers.class, "--debugwrong", "system_schema", "tables");
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("No sstables for"));
Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
assertEquals(1, tool.getExitCode());
assertCorrectEnvPostTest();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableExportTest method testPKArgOutOfOrder.
@Test
public void testPKArgOutOfOrder() {
ToolResult tool = ToolRunner.invokeClass(SSTableExport.class, "-k", "0", sstable);
assertThat(tool.getStdout(), containsStringIgnoringCase("usage:"));
assertThat(tool.getCleanedStderr(), containsStringIgnoringCase("You must supply exactly one sstable"));
assertThat(tool.getCleanedStderr(), containsStringIgnoringCase("before the -k/-x options"));
assertEquals(1, tool.getExitCode());
assertPostTestEnv();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableExportTest method testWrongArgFailsAndPrintsHelp.
@Test
public void testWrongArgFailsAndPrintsHelp() {
ToolResult tool = ToolRunner.invokeClass(SSTableExport.class, "--debugwrong", sstable);
assertThat(tool.getStdout(), containsStringIgnoringCase("usage:"));
assertThat(tool.getCleanedStderr(), containsStringIgnoringCase("Unrecognized option"));
assertEquals(1, tool.getExitCode());
assertPostTestEnv();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableExportTest method testMaybeChangeDocs.
@Test
public void testMaybeChangeDocs() {
// If you added, modified options or help, please update docs if necessary
ToolResult tool = ToolRunner.invokeClass(SSTableExport.class);
String help = "usage: sstabledump <sstable file path> <options>\n" + " \n" + "Dump contents of given SSTable to standard output in JSON format.\n" + " -d CQL row per line internal representation\n" + " -e enumerate partition keys only\n" + " -k <arg> List of included partition keys\n" + " -l Output json lines, by partition\n" + " -t Print raw timestamps instead of iso8601 date strings\n" + " -x <arg> List of excluded partition keys\n";
Assertions.assertThat(tool.getStdout()).isEqualTo(help);
assertPostTestEnv();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableExportTest method testNoArgsPrintsHelp.
@Test
public void testNoArgsPrintsHelp() {
ToolResult tool = ToolRunner.invokeClass(SSTableExport.class);
assertThat(tool.getStdout(), containsStringIgnoringCase("usage:"));
assertThat(tool.getCleanedStderr(), containsStringIgnoringCase("You must supply exactly one sstable"));
assertThat(tool.getCleanedStderr(), not(containsStringIgnoringCase("before the -k/-x options")));
assertEquals(1, tool.getExitCode());
assertPostTestEnv();
}
Aggregations