Search in sources :

Example 1 with CommandArg

use of org.apache.ignite.internal.commandline.argument.CommandArg in project ignite by apache.

the class GridCommandHandlerClusterByClassTest method testCacheHelp.

/**
 */
@Test
public void testCacheHelp() throws Exception {
    injectTestSystemOut();
    assertEquals(EXIT_CODE_OK, execute("--cache", "help"));
    String output = testOut.toString();
    for (CacheSubcommands cmd : CacheSubcommands.values()) {
        if (cmd != HELP) {
            assertContains(log, output, cmd.toString());
            Class<? extends Enum<? extends CommandArg>> args = cmd.getCommandArgs();
            if (args != null)
                for (Enum<? extends CommandArg> arg : args.getEnumConstants()) assertTrue(cmd + " " + arg, output.contains(arg.toString()));
        } else
            assertContains(log, output, CommandHandler.UTILITY_NAME);
    }
    checkHelp(output, "org.apache.ignite.util/" + getClass().getSimpleName() + "_cache_help.output");
}
Also used : CacheSubcommands(org.apache.ignite.internal.commandline.cache.CacheSubcommands) CommandArg(org.apache.ignite.internal.commandline.argument.CommandArg) GridAbstractTest(org.apache.ignite.testframework.junits.GridAbstractTest) Test(org.junit.Test)

Aggregations

CommandArg (org.apache.ignite.internal.commandline.argument.CommandArg)1 CacheSubcommands (org.apache.ignite.internal.commandline.cache.CacheSubcommands)1 GridAbstractTest (org.apache.ignite.testframework.junits.GridAbstractTest)1 Test (org.junit.Test)1