public TaskGroupExecutionLimitationType beginGroupLimitation() { TaskGroupExecutionLimitationType value = new TaskGroupExecutionLimitationType(); groupLimitation(value); return value; }
@NotNull private NodeType createLocalNodeObject(TaskManagerConfiguration configuration) { NodeType node = getPrismContext().createKnownObjectable(NodeType.class); String nodeId = configuration.getNodeId(); node.setNodeIdentifier(nodeId); node.setName(new PolyStringType(nodeId)); node.setHostname(getMyHostname()); node.getIpAddress().addAll(getMyIpAddresses()); node.setJmxPort(configuration.getJmxPort()); node.setClustered(configuration.isClustered()); node.setRunning(true); node.setLastCheckInTime(getCurrentTime()); node.setBuild(getBuildInformation()); node.setTaskExecutionLimitations( new TaskExecutionLimitationsType() .groupLimitation(new TaskGroupExecutionLimitationType().groupName("").limit(null)) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(nodeId).limit(null)) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(TaskConstants.LIMIT_FOR_OTHER_GROUPS).limit(0))); generateInternalNodeIdentifier(node); return node; }
@Test public void test120NodeAllowed() throws Exception { final String TEST_NAME = "test120NodeAllowed"; final OperationResult result = createResult(TEST_NAME, LOGGER); taskManager.getExecutionManager().setLocalExecutionLimitations( new TaskExecutionLimitationsType() .groupLimitation(new TaskGroupExecutionLimitationType().groupName("lightweight-tasks")) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(null)) .groupLimitation(new TaskGroupExecutionLimitationType().groupName(TaskConstants.LIMIT_FOR_OTHER_GROUPS).limit(0))); TaskType task = (TaskType) addObjectFromFile(taskFilename(TEST_NAME)).asObjectable(); waitForTaskStart(task.getOid(), result, 10000, 500); task = getTaskType(task.getOid(), result); assertNotNull("Task was not started even if it should be", task.getLastRunStartTimestamp()); }