use of org.eclipse.che.api.workspace.server.wsplugins.model.CheContainer in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addToolingContainerWithCommand.
@Test
public void addToolingContainerWithCommand() throws InfrastructureException {
List<String> command = Arrays.asList("tail", "-f", "/dev/null");
lenient().when(podSpec.getContainers()).thenReturn(new ArrayList<>());
ChePlugin chePlugin = createChePlugin();
List<CheContainer> containers = singletonList(createContainer(command, null));
chePlugin.setContainers(containers);
applier.apply(runtimeIdentity, internalEnvironment, singletonList(chePlugin));
verifyPodAndContainersNumber(1);
Container toolingContainer = getOneAndOnlyNonUserContainer(internalEnvironment);
verifyContainer(toolingContainer);
assertEquals(toolingContainer.getCommand(), command);
}
use of org.eclipse.che.api.workspace.server.wsplugins.model.CheContainer in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addToolingInitContainerWithCommandAndArgs.
@Test
public void addToolingInitContainerWithCommandAndArgs() throws InfrastructureException {
List<String> command = singletonList("cp");
List<String> args = Arrays.asList("-rf", "test-file", "/some-volume/test");
lenient().when(podSpec.getInitContainers()).thenReturn(new ArrayList<>());
ChePlugin chePlugin = createChePlugin();
List<CheContainer> initContainers = singletonList(createContainer(command, args));
chePlugin.setInitContainers(initContainers);
applier.apply(runtimeIdentity, internalEnvironment, singletonList(chePlugin));
verifyPodAndInitContainersNumber(1);
Container toolingInitContainer = getOnlyOneInitContainerFromPod(internalEnvironment);
verifyContainer(toolingInitContainer);
assertEquals(toolingInitContainer.getCommand(), command);
assertEquals(toolingInitContainer.getArgs(), args);
}
use of org.eclipse.che.api.workspace.server.wsplugins.model.CheContainer in project devspaces-images by redhat-developer.
the class MachineResolverTest method setUp.
@BeforeMethod
public void setUp() {
endpoints = new ArrayList<>();
cheContainer = new CheContainer();
container = new Container();
component = new ComponentImpl("chePlugin", PLUGIN_ID);
resolver = new MachineResolver(new Pair<>(PROJECTS_ENV_VAR, PROJECTS_MOUNT_PATH), container, cheContainer, DEFAULT_MEM_LIMIT, DEFAULT_MEM_REQUEST, DEFAULT_CPU_LIMIT, DEFAULT_CPU_REQUEST, endpoints, component);
}
Aggregations