use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testOperationName.
@Test
public void testOperationName() 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 testCommandArgumentName.
@Test
public void testCommandArgumentName() throws Exception {
final ParsedCommandLine parsed = parse("command-name --$" + OP_PROP_VAR_NAME + "=test");
assertEquals("command-name", parsed.getOperationName());
assertEquals(parsed.getPropertyValue("--" + OP_PROP_VAR_VALUE), "test");
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testArgumentValueInParenthesis.
@Test
public void testArgumentValueInParenthesis() throws Exception {
final ParsedCommandLine parsed = parse(":op(name=($" + OP_PROP_VAR_NAME + "))");
assertEquals("op", parsed.getOperationName());
assertEquals("(" + 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 testUnresolvedCommandArgumentValue.
@Test
public // variables unlike system properties are always resolved
void testUnresolvedCommandArgumentValue() throws Exception {
final ParsedCommandLine parsed = parse("command-name $" + OP_PROP_VAR_NAME + "=test");
assertEquals("command-name", parsed.getOperationName());
assertFalse(parsed.hasProperty(OP_PROP_VAR_VALUE));
assertFalse(parsed.hasProperty("--" + OP_PROP_VAR_VALUE));
assertEquals(1, parsed.getOtherProperties().size());
assertEquals(OP_PROP_VAR_VALUE + "=test", parsed.getOtherProperties().get(0));
}
use of org.jboss.as.cli.operation.ParsedCommandLine in project wildfly-core by wildfly.
the class VariablesTestCase method testOperationPropertyName.
@Test
public void testOperationPropertyName() throws Exception {
final ParsedCommandLine parsed = parse(":write-attribute($" + OP_PROP_VAR_NAME + "=test)");
assertEquals("write-attribute", parsed.getOperationName());
assertEquals(parsed.getPropertyValue(OP_PROP_VAR_VALUE), "test");
}
Aggregations