use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testQuotedOperationValue.
@Test
public void testQuotedOperationValue() throws Exception {
final ParsedCommandLine parsed = parse(":write-attribute(name=\"$" + OP_PROP_VAR_NAME + "\")");
assertEquals("write-attribute", parsed.getOperationName());
assertEquals("\"$" + 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 testComplexArgumentValue.
@Test
public void testComplexArgumentValue() throws Exception {
final ParsedCommandLine parsed = parse(":op(name={attr=$" + OP_PROP_VAR_NAME + "})");
assertEquals("op", parsed.getOperationName());
assertEquals("{attr=" + OP_PROP_VAR_VALUE + "}", parsed.getPropertyValue("name"));
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testCommandName.
@Test
public void testCommandName() throws Exception {
final ParsedCommandLine parsed = parse("$" + OP_VAR_NAME);
assertEquals(OP_VAR_VALUE, parsed.getOperationName());
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testQuotedArgumentValue.
@Test
public void testQuotedArgumentValue() throws Exception {
final ParsedCommandLine parsed = parse(":op(name=\"$" + OP_PROP_VAR_NAME + "\")");
assertEquals("op", parsed.getOperationName());
assertEquals("\"$" + 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 testHeaderNameAndValue.
@Test
public void testHeaderNameAndValue() throws Exception {
ParsedCommandLine parsed = parse(":write-attribute{$" + OP_PROP_VAR_NAME + "=$" + OP_VAR_NAME + "}");
assertEquals("write-attribute", parsed.getOperationName());
assertTrue(parsed.hasHeaders());
assertTrue(parsed.hasHeader(OP_PROP_VAR_VALUE));
ModelNode headers = new ModelNode();
parsed.getLastHeader().addTo(null, headers);
assertEquals(OP_VAR_VALUE, headers.get(OP_PROP_VAR_VALUE).asString());
parsed = parse(":write-attribute{$" + OP_PROP_VAR_NAME + " $" + OP_VAR_NAME + "}");
assertEquals("write-attribute", parsed.getOperationName());
assertTrue(parsed.hasHeaders());
assertTrue(parsed.hasHeader(OP_PROP_VAR_VALUE));
headers = new ModelNode();
parsed.getLastHeader().addTo(null, headers);
assertEquals(OP_VAR_VALUE, headers.get(OP_PROP_VAR_VALUE).asString());
}
Aggregations