use of org.eclipse.che.api.workspace.server.wsplugins.model.Command in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method shouldProvisionPluginsCommandsToEnvironment.
@Test
public void shouldProvisionPluginsCommandsToEnvironment() throws Exception {
// given
Command pluginCommand = new Command().name("test-command").workingDir("~").command(Arrays.asList("./build.sh", "--no-pull"));
// when
applier.apply(runtimeIdentity, internalEnvironment, singletonList(createChePlugin(createContainer("container", pluginCommand))));
// then
List<CommandImpl> envCommands = internalEnvironment.getCommands();
assertEquals(envCommands.size(), 1);
CommandImpl envCommand = envCommands.get(0);
assertEquals(envCommand.getName(), pluginCommand.getName());
assertEquals(envCommand.getCommandLine(), String.join(" ", pluginCommand.getCommand()));
assertEquals(envCommand.getType(), "custom");
assertEquals(envCommand.getAttributes().get(WORKING_DIRECTORY_ATTRIBUTE), pluginCommand.getWorkingDir());
validateContainerNameName(envCommand.getAttributes().get(MACHINE_NAME_ATTRIBUTE), "container");
}
use of org.eclipse.che.api.workspace.server.wsplugins.model.Command in project che-server by eclipse-che.
the class KubernetesPluginsToolingApplierTest method shouldProvisionPluginsCommandsToEnvironment.
@Test
public void shouldProvisionPluginsCommandsToEnvironment() throws Exception {
// given
Command pluginCommand = new Command().name("test-command").workingDir("~").command(Arrays.asList("./build.sh", "--no-pull"));
// when
applier.apply(runtimeIdentity, internalEnvironment, singletonList(createChePlugin(createContainer("container", pluginCommand))));
// then
List<CommandImpl> envCommands = internalEnvironment.getCommands();
assertEquals(envCommands.size(), 1);
CommandImpl envCommand = envCommands.get(0);
assertEquals(envCommand.getName(), pluginCommand.getName());
assertEquals(envCommand.getCommandLine(), String.join(" ", pluginCommand.getCommand()));
assertEquals(envCommand.getType(), "custom");
assertEquals(envCommand.getAttributes().get(WORKING_DIRECTORY_ATTRIBUTE), pluginCommand.getWorkingDir());
validateContainerNameName(envCommand.getAttributes().get(MACHINE_NAME_ATTRIBUTE), "container");
}
Aggregations