QueueUtils { public static String getExecutionNameSpace(String queueName) { if (StringUtils.contains(queueName, ISOLATION_SEPARATOR) && StringUtils.contains(queueName, EXECUTION_NAME_SPACE_SEPRATOR)) { return StringUtils.substringBetween(queueName, EXECUTION_NAME_SPACE_SEPRATOR, ISOLATION_SEPARATOR); } else if (StringUtils.contains(queueName, EXECUTION_NAME_SPACE_SEPRATOR)) { return StringUtils.substringAfter(queueName, EXECUTION_NAME_SPACE_SEPRATOR); } else { return StringUtils.EMPTY; } }  static String getQueueName(Task task); static String getQueueName(String taskType, String domain, String isolationGroup, String executionNameSpace); static String getQueueNameWithoutDomain(String queueName); static String getExecutionNameSpace(String queueName); static boolean isIsolatedQueue(String queue); static String getTaskType(String queue); static final String DOMAIN_SEPARATOR; static final String ISOLATION_SEPARATOR; static final String EXECUTION_NAME_SPACE_SEPRATOR; }
@Test public void testGetExecutionNameSpace() { String executionNameSpace = QueueUtils.getExecutionNameSpace("domain:queueName@eN-iso"); Assert.assertEquals(executionNameSpace,"eN"); }
@Test public void testGetQueueExecutionNameSpaceEmpty() { Assert.assertEquals(QueueUtils.getExecutionNameSpace("queueName"),""); }
@Test public void testGetQueueExecutionNameSpaceWithIsolationGroup() { Assert.assertEquals(QueueUtils.getExecutionNameSpace("domain:test@executionNameSpace-isolated"),"executionNameSpace"); }