@Test public void testGetMin() { assertEquals(1, ContainerAllocationTaskService.getMinParam(0, 1L).longValue()); assertEquals(1, ContainerAllocationTaskService.getMinParam(1, null).longValue()); assertEquals(1, ContainerAllocationTaskService.getMinParam(2, 1L).longValue()); assertEquals(1, ContainerAllocationTaskService.getMinParam(1, 2L).longValue()); assertEquals(0, ContainerAllocationTaskService.getMinParam(0, null).longValue()); assertEquals(1, ContainerAllocationTaskService.getMinParam(1, 0L).longValue()); }
.getDefaultTaskExpirationTimeInMicros(); containerState.memoryLimit = getMinParam(groupResourcePlacementState.memoryLimit, containerDesc.memoryLimit); Long cpuShares = getMinParam(groupResourcePlacementState.cpuShares, containerDesc.cpuShares); containerState.cpuShares = cpuShares != null ? cpuShares.intValue() : null;
.getMinParam(groupPlacementState.cpuShares, containerDesc.cpuShares.longValue()) .longValue(), containerState.cpuShares.longValue()); assertEquals(ContainerAllocationTaskService .getMinParam(groupPlacementState.memoryLimit, containerDesc.memoryLimit), containerState.memoryLimit);