use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldNotSetMemLimitAttributeIfLimitIsInContainer.
@Test
public void shouldNotSetMemLimitAttributeIfLimitIsInContainer() throws InfrastructureException {
Containers.addRamLimit(container, 123456789);
InternalMachineConfig machineConfig = resolver.resolve();
assertNull(machineConfig.getAttributes().get(MEMORY_LIMIT_ATTRIBUTE));
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetCPURequestOfASidecarIfCorrespondingComponentFieldIsSet.
@Test(dataProvider = "cpuAttributeRequestProvider")
public void shouldSetCPURequestOfASidecarIfCorrespondingComponentFieldIsSet(String cpuRequest, String expectedCpuRequest) throws InfrastructureException {
component.setCpuRequest(cpuRequest);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(CPU_REQUEST_ATTRIBUTE), expectedCpuRequest);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetCPULimitOfASidecarIfCorrespondingComponentFieldIsSet.
@Test(dataProvider = "cpuAttributeLimitProvider")
public void shouldSetCPULimitOfASidecarIfCorrespondingComponentFieldIsSet(String cpuLimit, String expectedCpuLimit) throws InfrastructureException {
component.setCpuLimit(cpuLimit);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(CPU_LIMIT_ATTRIBUTE), expectedCpuLimit);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetServersInMachineConfig.
@Test(dataProvider = "serverProvider")
public void shouldSetServersInMachineConfig(List<ChePluginEndpoint> containerEndpoints, Map<String, ServerConfig> expected) throws InfrastructureException {
endpoints.addAll(containerEndpoints);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getServers(), expected);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetMemoryLimitOfASidecarIfCorrespondingComponentFieldIsSet.
@Test(dataProvider = "memoryLimitAttributeProvider")
public void shouldSetMemoryLimitOfASidecarIfCorrespondingComponentFieldIsSet(String memoryLimit, String expectedMemLimit) throws InfrastructureException {
component.setMemoryLimit(memoryLimit);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(MEMORY_LIMIT_ATTRIBUTE), expectedMemLimit);
}
Aggregations