use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testNodeName.
@Test
public void testNodeName() throws Exception {
final ParsedCommandLine parsed = parse("/test=$" + NODE_NAME_VAR_NAME + ":op");
final OperationRequestAddress address = parsed.getAddress();
assertNotNull(address);
assertEquals("test", address.getNodeType());
assertEquals(NODE_NAME_VAR_VALUE, address.getNodeName());
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testVariablesInTheMix.
@Test
public void testVariablesInTheMix() throws Exception {
final ParsedCommandLine parsed = parse("co$" + OP_VAR_NAME + "$" + OP_VAR_NAME + " $" + OP_PROP_VAR_NAME + ":$" + OP_PROP_VAR_NAME);
assertEquals("co" + OP_VAR_VALUE + OP_VAR_VALUE, parsed.getOperationName());
final List<String> props = parsed.getOtherProperties();
assertEquals(1, props.size());
assertEquals(OP_PROP_VAR_VALUE + ':' + OP_PROP_VAR_VALUE, props.get(0));
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testDMRArgumentValue.
@Test
public void testDMRArgumentValue() throws Exception {
final ParsedCommandLine parsed = parse(":op(name = {\"attr\" => \"$" + OP_PROP_VAR_NAME + "\"})");
assertEquals("op", parsed.getOperationName());
assertEquals("{\"attr\" => \"$" + OP_PROP_VAR_NAME + "\"}", parsed.getPropertyValue("name"));
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testLastChunkIndex.
@Test
public void testLastChunkIndex() throws Exception {
final ParsedCommandLine parsed = parse("$myvar:re");
assertEquals("re", parsed.getOperationName());
assertEquals(7, parsed.getLastChunkOriginalIndex());
assertEquals(19, parsed.getLastChunkIndex());
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testOperationComplexValue.
@Test
public void testOperationComplexValue() throws Exception {
final ParsedCommandLine parsed = parse(":write-attribute(name={attr=$" + OP_PROP_VAR_NAME + "})");
assertEquals("write-attribute", parsed.getOperationName());
assertEquals("{attr=" + OP_PROP_VAR_VALUE + "}", parsed.getPropertyValue("name"));
}
Aggregations