Search in sources :

Example 6 with ParseResult

use of org.yamcs.studio.commanding.CommandParser.ParseResult in project yamcs-studio by yamcs.

the class CommandParserTest method testIntegerArguments.

@Test
public void testIntegerArguments() {
    ParseResult commandType = CommandParser.parseCommand("/YSS/SIMULATOR/SWITCH_VOLTAGE_ON(voltage_num: 1)");
    assertEquals("/YSS/SIMULATOR/SWITCH_VOLTAGE_ON", commandType.getQualifiedName());
    assertEquals(1, commandType.getAssignments().size());
    Assignment arg0 = commandType.getAssignments().get(0);
    assertEquals("voltage_num", arg0.getName());
    assertEquals("1", arg0.getValue());
}
Also used : Assignment(org.yamcs.protobuf.Rest.IssueCommandRequest.Assignment) ParseResult(org.yamcs.studio.commanding.CommandParser.ParseResult) Test(org.junit.Test)

Aggregations

ParseResult (org.yamcs.studio.commanding.CommandParser.ParseResult)6 Test (org.junit.Test)5 Assignment (org.yamcs.protobuf.Rest.IssueCommandRequest.Assignment)4 IssueCommandRequest (org.yamcs.protobuf.Rest.IssueCommandRequest)1 CommandingCatalogue (org.yamcs.studio.core.model.CommandingCatalogue)1