use of io.vertx.core.spi.launcher.CommandFactory in project vert.x by eclipse.
the class ServiceCommandLoaderTest method ensureCommand.
private void ensureCommand(Collection<CommandFactory<?>> commands, String name) {
List<CLI> clis = new ArrayList<>();
for (CommandFactory command : commands) {
CLI cli = command.define();
clis.add(cli);
if (cli.getName().equalsIgnoreCase(name)) {
return;
}
}
fail("Cannot find '" + name + "' in " + clis.stream().map(CLI::getName).collect(Collectors.toList()));
}
use of io.vertx.core.spi.launcher.CommandFactory in project vert.x by eclipse.
the class ServiceCommandLookupTest method ensureCommand.
private void ensureCommand(Collection<CommandFactory<?>> commands, String name) {
List<CLI> clis = new ArrayList<>();
for (CommandFactory command : commands) {
CLI cli = command.define();
clis.add(cli);
if (cli.getName().equalsIgnoreCase(name)) {
return;
}
}
fail("Cannot find '" + name + "' in " + clis.stream().map(CLI::getName).collect(Collectors.toList()));
}
use of io.vertx.core.spi.launcher.CommandFactory in project vert.x by eclipse.
the class ServiceCommandLoaderTest method testCommandsWhenUsingClassloaderHierarchy.
@Test
public void testCommandsWhenUsingClassloaderHierarchy() {
ClassLoader classLoader = new URLClassLoader(new URL[0], ServiceCommandLoaderTest.class.getClassLoader());
loader = new ServiceCommandFactoryLoader(classLoader);
Collection<CommandFactory<?>> commands = loader.lookup();
ensureCommand(commands, "Hello");
ensureCommand(commands, "Bye");
}
Aggregations