use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addsMachineWithVolumeFromChePlugin.
@Test
public void addsMachineWithVolumeFromChePlugin() throws Exception {
// given
ChePlugin chePluginWithNoVolume = createChePlugin();
chePluginWithNoVolume.getContainers().get(0).setVolumes(emptyList());
// when
applier.apply(runtimeIdentity, internalEnvironment, asList(createChePlugin(), chePluginWithNoVolume));
// then
Collection<InternalMachineConfig> machineConfigs = getNonUserMachines(internalEnvironment);
assertEquals(machineConfigs.size(), 2);
verifyNumberOfMachinesWithSpecificNumberOfVolumes(machineConfigs, 2, 0);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetDefaultCPULimitAndRequestIfSidecarDoesNotHaveOne.
@Test
public void shouldSetDefaultCPULimitAndRequestIfSidecarDoesNotHaveOne() throws InfrastructureException {
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(CPU_LIMIT_ATTRIBUTE), DEFAULT_CPU_LIMIT);
assertEquals(machineConfig.getAttributes().get(CPU_REQUEST_ATTRIBUTE), DEFAULT_CPU_REQUEST);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetMemoryRequestOfASidecarIfCorrespondingComponentFieldIsSet.
@Test(dataProvider = "memoryRequestAttributeProvider")
public void shouldSetMemoryRequestOfASidecarIfCorrespondingComponentFieldIsSet(String memoryRequest, String expectedMemRequest) throws InfrastructureException {
component.setMemoryRequest(memoryRequest);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(MEMORY_REQUEST_ATTRIBUTE), expectedMemRequest);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldAddEndpointsFromDevfileComponent.
@Test
public void shouldAddEndpointsFromDevfileComponent() throws InfrastructureException {
component.setEndpoints(asList(new EndpointImpl("endpoint8080", 8080, Collections.emptyMap()), new EndpointImpl("endpoint9999", 9999, ImmutableMap.of("secure", "true"))));
InternalMachineConfig config = resolver.resolve();
assertEquals(config.getServers().size(), 2);
assertEquals(config.getServers().get("endpoint8080").getPort(), "8080");
assertEquals(config.getServers().get("endpoint9999").getPort(), "9999");
assertEquals(config.getServers().get("endpoint9999").getAttributes().get("secure"), "true");
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldAddVolumesFromDevfileComponent.
@Test
public void shouldAddVolumesFromDevfileComponent() throws InfrastructureException {
component.setVolumes(asList(new org.eclipse.che.api.workspace.server.model.impl.devfile.VolumeImpl("foo", "/bar"), new org.eclipse.che.api.workspace.server.model.impl.devfile.VolumeImpl("test", "/foo/test")));
InternalMachineConfig config = resolver.resolve();
assertEquals(2, config.getVolumes().size());
assertEquals("/bar", config.getVolumes().get("foo").getPath());
assertEquals("/foo/test", config.getVolumes().get("test").getPath());
}
Aggregations