use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableRepairedAtSetterTest method testNoArgsPrintsHelp.
@Test
public void testNoArgsPrintsHelp() {
ToolResult tool = ToolRunner.invokeClass(SSTableRepairedAtSetter.class);
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
assertEquals(1, tool.getExitCode());
assertNoUnexpectedThreadsStarted(null);
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableRepairedAtSetterTest method testIsunrepairedArg.
@Test
public void testIsunrepairedArg() throws Exception {
ToolResult tool = ToolRunner.invokeClass(SSTableRepairedAtSetter.class, "--really-set", "--is-unrepaired", findOneSSTable("legacy_sstables", "legacy_ma_simple"));
tool.assertOnCleanExit();
assertNoUnexpectedThreadsStarted(OPTIONAL_THREADS_WITH_SCHEMA);
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableRepairedAtSetterTest method testFilesArg.
@Test
public void testFilesArg() throws Exception {
File tmpFile = FileUtils.createTempFile("sstablelist.txt", "tmp");
tmpFile.deleteOnExit();
Files.write(tmpFile.toPath(), findOneSSTable("legacy_sstables", "legacy_ma_simple").getBytes());
String file = tmpFile.absolutePath();
ToolResult tool = ToolRunner.invokeClass(SSTableRepairedAtSetter.class, "--really-set", "--is-repaired", "-f", file);
tool.assertOnCleanExit();
assertNoUnexpectedThreadsStarted(OPTIONAL_THREADS_WITH_SCHEMA);
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableRepairedAtSetterTest method testWrongArgFailsAndPrintsHelp.
@Test
public void testWrongArgFailsAndPrintsHelp() throws IOException {
ToolResult tool = ToolRunner.invokeClass(SSTableRepairedAtSetter.class, "--debugwrong", findOneSSTable("legacy_sstables", "legacy_ma_simple"));
assertThat(tool.getStdout(), CoreMatchers.containsStringIgnoringCase("usage:"));
Assertions.assertThat(tool.getCleanedStderr()).isEmpty();
assertEquals(1, tool.getExitCode());
}
use of org.apache.cassandra.tools.ToolRunner.ToolResult in project cassandra by apache.
the class SSTableRepairedAtSetterTest method testIsrepairedArg.
@Test
public void testIsrepairedArg() throws Exception {
ToolResult tool = ToolRunner.invokeClass(SSTableRepairedAtSetter.class, "--really-set", "--is-repaired", findOneSSTable("legacy_sstables", "legacy_ma_simple"));
tool.assertOnCleanExit();
assertNoUnexpectedThreadsStarted(OPTIONAL_THREADS_WITH_SCHEMA);
assertSchemaNotLoaded();
assertCLSMNotLoaded();
assertSystemKSNotLoaded();
assertKeyspaceNotLoaded();
assertServerNotLoaded();
}
Aggregations