use of org.elasticsearch.cli.MockTerminal in project elasticsearch by elastic.
the class InstallPluginCommandTests method testQuietFlagDisabled.
public void testQuietFlagDisabled() throws Exception {
MockTerminal terminal = new MockTerminal();
terminal.setVerbosity(randomFrom(Terminal.Verbosity.NORMAL, Terminal.Verbosity.VERBOSE));
installPlugin(terminal, false);
assertThat(terminal.getOutput(), containsString("100%"));
}
use of org.elasticsearch.cli.MockTerminal in project elasticsearch by elastic.
the class ListPluginsCommandTests method testOnePlugin.
public void testOnePlugin() throws Exception {
buildFakePlugin(env, "fake desc", "fake", "org.fake");
MockTerminal terminal = listPlugins(home);
assertEquals(terminal.getOutput(), buildMultiline("fake"));
}
use of org.elasticsearch.cli.MockTerminal in project elasticsearch by elastic.
the class ListPluginsCommandTests method testTwoPlugins.
public void testTwoPlugins() throws Exception {
buildFakePlugin(env, "fake desc", "fake1", "org.fake");
buildFakePlugin(env, "fake desc 2", "fake2", "org.fake");
MockTerminal terminal = listPlugins(home);
assertEquals(terminal.getOutput(), buildMultiline("fake1", "fake2"));
}
use of org.elasticsearch.cli.MockTerminal in project elasticsearch by elastic.
the class ListPluginsCommandTests method testPluginWithVerboseMultiplePlugins.
public void testPluginWithVerboseMultiplePlugins() throws Exception {
buildFakePlugin(env, "fake desc 1", "fake_plugin1", "org.fake");
buildFakePlugin(env, "fake desc 2", "fake_plugin2", "org.fake2");
String[] params = { "-v" };
MockTerminal terminal = listPlugins(home, params);
assertEquals(terminal.getOutput(), buildMultiline("Plugins directory: " + env.pluginsFile(), "fake_plugin1", "- Plugin information:", "Name: fake_plugin1", "Description: fake desc 1", "Version: 1.0", " * Classname: org.fake", "fake_plugin2", "- Plugin information:", "Name: fake_plugin2", "Description: fake desc 2", "Version: 1.0", " * Classname: org.fake2"));
}
use of org.elasticsearch.cli.MockTerminal in project elasticsearch by elastic.
the class RemovePluginCommandTests method testNoConfigDirPreserved.
public void testNoConfigDirPreserved() throws Exception {
Files.createDirectories(env.pluginsFile().resolve("fake"));
final Path configDir = env.configFile().resolve("fake");
final MockTerminal terminal = removePlugin("fake", home);
assertThat(terminal.getOutput(), not(containsString(expectedConfigDirPreservedMessage(configDir))));
}
Aggregations