use of org.opensearch.cli.MockTerminal in project OpenSearch by opensearch-project.
the class ListPluginsCommandTests method testPluginWithoutVerboseMultiplePlugins.
public void testPluginWithoutVerboseMultiplePlugins() throws Exception {
buildFakePlugin(env, "fake desc 1", "fake_plugin1", "org.fake");
buildFakePlugin(env, "fake desc 2", "fake_plugin2", "org.fake2");
MockTerminal terminal = listPlugins(home, new String[0]);
String output = terminal.getOutput();
assertEquals(buildMultiline("fake_plugin1", "fake_plugin2"), output);
}
use of org.opensearch.cli.MockTerminal in project OpenSearch by opensearch-project.
the class ListPluginsCommandTests method testOnePlugin.
public void testOnePlugin() throws Exception {
buildFakePlugin(env, "fake desc", "fake", "org.fake");
MockTerminal terminal = listPlugins(home);
assertEquals(buildMultiline("fake"), terminal.getOutput());
}
use of org.opensearch.cli.MockTerminal in project OpenSearch by opensearch-project.
the class ListPluginsCommandTests method testPluginWithNativeController.
public void testPluginWithNativeController() throws Exception {
buildFakePlugin(env, "fake desc 1", "fake_plugin1", "org.fake", true);
String[] params = { "-v" };
MockTerminal terminal = listPlugins(home, params);
assertEquals(buildMultiline("Plugins directory: " + env.pluginsFile(), "fake_plugin1", "- Plugin information:", "Name: fake_plugin1", "Description: fake desc 1", "Version: 1.0", "OpenSearch Version: " + Version.CURRENT.toString(), "Java Version: 1.8", "Native Controller: true", "Extended Plugins: []", " * Classname: org.fake", "Folder name: custom-folder"), terminal.getOutput());
}
use of org.opensearch.cli.MockTerminal in project OpenSearch by opensearch-project.
the class ListPluginsCommandTests method testPluginWithVerbose.
public void testPluginWithVerbose() throws Exception {
buildFakePlugin(env, "fake desc", "fake_plugin", "org.fake");
String[] params = { "-v" };
MockTerminal terminal = listPlugins(home, params);
assertEquals(buildMultiline("Plugins directory: " + env.pluginsFile(), "fake_plugin", "- Plugin information:", "Name: fake_plugin", "Description: fake desc", "Version: 1.0", "OpenSearch Version: " + Version.CURRENT.toString(), "Java Version: 1.8", "Native Controller: false", "Extended Plugins: []", " * Classname: org.fake", "Folder name: custom-folder"), terminal.getOutput());
}
use of org.opensearch.cli.MockTerminal in project OpenSearch by opensearch-project.
the class InstallPluginCommandTests method testQuietFlagEnabled.
public void testQuietFlagEnabled() throws Exception {
MockTerminal terminal = new MockTerminal();
terminal.setVerbosity(Terminal.Verbosity.SILENT);
installPlugin(terminal, false);
assertThat(terminal.getOutput(), not(containsString("100%")));
}
Aggregations