@Test public void testEndsOnGroupConcurrent() throws Exception { parse(":do{ rollout groupA( prop = v ) ^"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertTrue(rollout.endsOnGroupSeparator()); assertEquals(32, rollout.getLastSeparatorIndex()); }
@Test public void testRolloutIdWithValue() throws Exception { parse(":do{ rollout id = myplan}"); assertFalse(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertTrue(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); final ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; assertEquals("myplan", rollout.getPlanRef()); assertEquals(18, rollout.getLastChunkIndex()); }
@Test public void testEndsOnGroupPropertiesEnd() throws Exception { parse("/profile=default/subsystem=threads/thread-factory=mytf:do{ rollout groupA()"); assertTrue(handler.hasAddress()); assertTrue(handler.hasOperationName()); assertFalse(handler.hasProperties()); assertFalse(handler.endsOnAddressOperationNameSeparator()); assertFalse(handler.endsOnPropertyListStart()); assertFalse(handler.endsOnPropertySeparator()); assertFalse(handler.endsOnPropertyValueSeparator()); assertFalse(handler.endsOnNodeSeparator()); assertFalse(handler.endsOnNodeTypeNameSeparator()); assertFalse(handler.endsOnSeparator()); assertFalse(handler.endsOnHeaderListStart()); assertFalse(handler.isRequestComplete()); assertTrue(handler.hasHeaders()); final Collection<ParsedOperationRequestHeader> headers = handler.getHeaders(); assertEquals(1, headers.size()); final ParsedOperationRequestHeader header = headers.iterator().next(); assertTrue(header instanceof ParsedRolloutPlanHeader); ParsedRolloutPlanHeader rollout = (ParsedRolloutPlanHeader) header; final SingleRolloutPlanGroup group = rollout.getLastGroup(); assertNotNull(group); assertEquals("groupA", group.getGroupName()); assertFalse(group.endsOnPropertyListStart()); assertTrue(group.endsOnPropertyListEnd()); assertFalse(group.hasProperties()); }