use of org.jboss.as.cli.operation.OperationRequestAddress.Node in project wildfly-core by wildfly.
the class AddressOnlyParsingTestCase method testParentOnly.
@Test
public void testParentOnly() throws Exception {
OperationRequestAddress prefix = new DefaultOperationRequestAddress();
prefix.toNode("a", "b");
DefaultCallbackHandler handler = new DefaultCallbackHandler(prefix);
parser.parse("..", handler);
assertTrue(handler.hasAddress());
assertFalse(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.isRequestComplete());
OperationRequestAddress address = handler.getAddress();
assertFalse(address.endsOnType());
Iterator<Node> i = address.iterator();
assertFalse(i.hasNext());
}
use of org.jboss.as.cli.operation.OperationRequestAddress.Node in project wildfly-core by wildfly.
the class AddressOnlyParsingTestCase method testNodeNameOnly.
@Test
public void testNodeNameOnly() throws Exception {
OperationRequestAddress prefix = new DefaultOperationRequestAddress();
prefix.toNodeType("a");
DefaultCallbackHandler handler = new DefaultCallbackHandler(prefix);
parser.parse("b", handler);
assertTrue(handler.hasAddress());
assertFalse(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.isRequestComplete());
OperationRequestAddress address = handler.getAddress();
assertFalse(address.endsOnType());
Iterator<Node> i = address.iterator();
assertTrue(i.hasNext());
Node node = i.next();
assertNotNull(node);
assertEquals("a", node.getType());
assertEquals("b", node.getName());
assertFalse(i.hasNext());
}
use of org.jboss.as.cli.operation.OperationRequestAddress.Node in project wildfly-core by wildfly.
the class AddressOnlyParsingTestCase method testRootOnly.
@Test
public void testRootOnly() throws Exception {
OperationRequestAddress prefix = new DefaultOperationRequestAddress();
prefix.toNode("a", "b");
DefaultCallbackHandler handler = new DefaultCallbackHandler(prefix);
parser.parse("/", handler);
assertTrue(handler.hasAddress());
assertFalse(handler.hasOperationName());
assertFalse(handler.hasProperties());
assertFalse(handler.endsOnAddressOperationNameSeparator());
assertFalse(handler.endsOnPropertyListStart());
assertFalse(handler.endsOnPropertySeparator());
assertFalse(handler.endsOnPropertyValueSeparator());
// root is also a separator
assertTrue(handler.endsOnNodeSeparator());
assertFalse(handler.endsOnNodeTypeNameSeparator());
assertFalse(handler.isRequestComplete());
OperationRequestAddress address = handler.getAddress();
assertFalse(address.endsOnType());
Iterator<Node> i = address.iterator();
assertFalse(i.hasNext());
}
use of org.jboss.as.cli.operation.OperationRequestAddress.Node in project wildfly-core by wildfly.
the class AddressOnlyParsingTestCase method testParentInCombination.
@Test
public void testParentInCombination() throws Exception {
DefaultCallbackHandler handler = new DefaultCallbackHandler();
parser.parse("c=d/../e=f", handler);
assertTrue(handler.hasAddress());
assertFalse(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.isRequestComplete());
OperationRequestAddress address = handler.getAddress();
assertFalse(address.endsOnType());
Iterator<Node> i = address.iterator();
assertTrue(i.hasNext());
Node node = i.next();
assertNotNull(node);
assertEquals("e", node.getType());
assertEquals("f", node.getName());
assertFalse(i.hasNext());
}
use of org.jboss.as.cli.operation.OperationRequestAddress.Node in project wildfly-core by wildfly.
the class AddressOnlyParsingTestCase method testOneNodeWithNodeSeparator.
@Test
public void testOneNodeWithNodeSeparator() throws Exception {
DefaultCallbackHandler handler = new DefaultCallbackHandler();
parser.parse("subsystem=logging/", handler);
assertTrue(handler.hasAddress());
assertFalse(handler.hasOperationName());
assertFalse(handler.hasProperties());
assertFalse(handler.endsOnAddressOperationNameSeparator());
assertFalse(handler.endsOnPropertyListStart());
assertFalse(handler.endsOnPropertySeparator());
assertFalse(handler.endsOnPropertyValueSeparator());
assertTrue(handler.endsOnNodeSeparator());
assertFalse(handler.endsOnNodeTypeNameSeparator());
assertFalse(handler.isRequestComplete());
OperationRequestAddress address = handler.getAddress();
assertFalse(address.endsOnType());
Iterator<Node> i = address.iterator();
assertTrue(i.hasNext());
Node node = i.next();
assertNotNull(node);
assertEquals("subsystem", node.getType());
assertEquals("logging", node.getName());
assertFalse(i.hasNext());
}
Aggregations