use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableRepairedAtSetterTest method testMaybeChangeDocs.
@Test
public void testMaybeChangeDocs() {
// If you added, modified options or help, please update docs if necessary
ToolResult tool = ToolRunner.invokeClass(SSTableRepairedAtSetter.class, "-h");
String help = "This command should be run with Cassandra stopped, otherwise you will get very strange behavior\n" + "Verify that Cassandra is not running and then execute the command like this:\n" + "Usage: sstablerepairedset --really-set [--is-repaired | --is-unrepaired] [-f <sstable-list> | <sstables>]\n";
Assertions.assertThat(tool.getStdout()).isEqualTo(help);
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class StandaloneSSTableUtilTest method testCleanupArg.
@Test
public void testCleanupArg() {
Arrays.asList("-c", "--cleanup").forEach(arg -> {
ToolResult tool = ToolRunner.invokeClass(StandaloneSSTableUtil.class, arg, "system_schema", "tables");
assertThat("Arg: [" + arg + "]", tool.getStdout(), CoreMatchers.containsStringIgnoringCase("Cleaning up..."));
Assertions.assertThat(tool.getCleanedStderr()).as("Arg: [%s]", arg).isEmpty();
tool.assertOnExitCode();
assertCorrectEnvPostTest();
});
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class StandaloneSSTableUtilTest method testHelpArg.
@Test
public void testHelpArg() {
Arrays.asList("-h", "--help").forEach(arg -> {
ToolResult tool = ToolRunner.invokeClass(StandaloneSSTableUtil.class, arg);
assertThat("Arg: [" + arg + "]", tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
Assertions.assertThat(tool.getCleanedStderr()).as("Arg: [%s]", arg).isEmpty();
tool.assertOnExitCode();
assertCorrectEnvPostTest();
});
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class StandaloneSSTableUtilTest method testListFilesArgs.
@Test
public void testListFilesArgs() {
Arrays.asList("-d", "--debug", "-o", "-oplog", "-v", "--verbose").forEach(arg -> {
ToolResult tool = ToolRunner.invokeClass(StandaloneSSTableUtil.class, arg, "system_schema", "tables");
Assertions.assertThat(tool.getStdout()).as("Arg: [%s]", arg).isEqualTo("Listing files...\n");
Assertions.assertThat(tool.getCleanedStderr()).as("Arg: [%s]", arg).isEmpty();
tool.assertOnExitCode();
assertCorrectEnvPostTest();
});
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class StandaloneSplitterTest method testMaybeChangeDocs.
@Test
public void testMaybeChangeDocs() {
// If you added, modified options or help, please update docs if necessary
ToolResult tool = ToolRunner.invokeClass(StandaloneSplitter.class, "-h");
String help = "usage: sstablessplit [options] <filename> [<filename>]*\n" + "--\n" + "Split the provided sstables files in sstables of maximum provided file\n" + "size (see option --size).\n" + "--\n" + "Options are:\n" + " --debug display stack traces\n" + " -h,--help display this help message\n" + " --no-snapshot don't snapshot the sstables before splitting\n" + " -s,--size <size> maximum size in MB for the output sstables (default:\n" + " 50)\n";
Assertions.assertThat(tool.getStdout()).isEqualTo(help);
}
Aggregations