Search in sources :

Example 51 with ToolResult

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

the class GetVersionTest method testGetVersion.

@Test
public void testGetVersion() {
    ToolResult tool = ToolRunner.invokeClass(GetVersion.class);
    tool.assertOnCleanExit();
    assertNoUnexpectedThreadsStarted(null);
    assertSchemaNotLoaded();
    assertCLSMNotLoaded();
    assertSystemKSNotLoaded();
    assertKeyspaceNotLoaded();
    assertServerNotLoaded();
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 52 with ToolResult

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

the class JMXToolTest method cliHelpDump.

@Test
public void cliHelpDump() {
    ToolResult result = jmxtool("help", "dump");
    result.assertOnCleanExit();
    Assertions.assertThat(result.getStdout()).isEqualTo("NAME\n" + "        jmxtool dump - Dump the Apache Cassandra JMX objects and metadata.\n" + "\n" + "SYNOPSIS\n" + "        jmxtool dump [(-f <format> | --format <format>)] [(-h | --help)]\n" + "                [(-u <url> | --url <url>)]\n" + "\n" + "OPTIONS\n" + "        -f <format>, --format <format>\n" + "            What format to dump content as; supported values are console\n" + "            (default), json, and yaml\n" + "\n" + "        -h, --help\n" + "            Display help information\n" + "\n" + "        -u <url>, --url <url>\n" + "            JMX url to target\n" + "\n" + "\n");
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 53 with ToolResult

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

the class JMXToolTest method cliHelp.

@Test
public void cliHelp() {
    ToolResult result = jmxtool();
    result.assertOnCleanExit();
    Assertions.assertThat(result.getStdout()).isEqualTo("usage: jmxtool <command> [<args>]\n" + "\n" + "The most commonly used jmxtool commands are:\n" + "    diff   Diff two jmx dump files and report their differences\n" + "    dump   Dump the Apache Cassandra JMX objects and metadata.\n" + "    help   Display help information\n" + "\n" + "See 'jmxtool help <command>' for more information on a specific command.\n" + "\n");
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 54 with ToolResult

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

the class JMXToolTest method cliHelpDiff.

@Test
public void cliHelpDiff() {
    ToolResult result = jmxtool("help", "diff");
    result.assertOnCleanExit();
    Assertions.assertThat(result.getStdout()).isEqualTo("NAME\n" + "        jmxtool diff - Diff two jmx dump files and report their differences\n" + "\n" + "SYNOPSIS\n" + "        jmxtool diff [--exclude-attribute <exclude attributes>...]\n" + "                [--exclude-object <exclude objects>...]\n" + "                [--exclude-operation <exclude operations>...]\n" + "                [(-f <format> | --format <format>)] [(-h | --help)]\n" + "                [--ignore-missing-on-left] [--ignore-missing-on-right] [--] <left>\n" + "                <right>\n" + "\n" + "OPTIONS\n" + "        --exclude-attribute <exclude attributes>\n" + "            Ignores processing specific attributes. Each usage should take a\n" + "            single attribute, but can use this flag multiple times.\n" + "\n" + "        --exclude-object <exclude objects>\n" + "            Ignores processing specific objects. Each usage should take a single\n" + "            object, but can use this flag multiple times.\n" + "\n" + "        --exclude-operation <exclude operations>\n" + "            Ignores processing specific operations. Each usage should take a\n" + "            single operation, but can use this flag multiple times.\n" + "\n" + "        -f <format>, --format <format>\n" + "            What format the files are in; only support json and yaml as format\n" + "\n" + "        -h, --help\n" + "            Display help information\n" + "\n" + "        --ignore-missing-on-left\n" + "            Ignore results missing on the left\n" + "\n" + "        --ignore-missing-on-right\n" + "            Ignore results missing on the right\n" + "\n" + "        --\n" + "            This option can be used to separate command-line options from the\n" + "            list of argument, (useful when arguments might be mistaken for\n" + "            command-line options\n" + "\n" + "        <left> <right>\n" + "            Files to diff\n" + "\n" + "\n");
}
Also used : ToolResult(org.apache.cassandra.tools.ToolRunner.ToolResult) Test(org.junit.Test)

Example 55 with ToolResult

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

the class SSTableExpiredBlockersTest method testMaybeChangeDocs.

@Test
public void testMaybeChangeDocs() {
    // If you added, modified options or help, please update docs if necessary
    ToolResult tool = ToolRunner.invokeClass(SSTableExpiredBlockers.class);
    String help = "Usage: sstableexpiredblockers <keyspace> <table>\n";
    Assertions.assertThat(tool.getStdout()).isEqualTo(help);
}
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