use of de.be4.eventbalg.core.parser.node.AAction in project probparsers by bendisposto.
the class CommentTest method testAtSignInComment.
@Test
public void testAtSignInComment() throws Exception {
final Start rootNode = parseInput("machine AtSignInComment\nevents\nevent testEvent\nthen\n@act1 skip\n@act2 skip\n// MyComment@act2\nend\nend", false);
final AMachineParseUnit parseUnit = (AMachineParseUnit) rootNode.getPParseUnit();
final AEvent event = (AEvent) parseUnit.getEvents().get(0);
final LinkedList<PAction> actions = event.getActions();
AAction labeledAction = (AAction) actions.get(0);
assertEquals("act1", labeledAction.getName().getText());
assertEquals("skip", labeledAction.getAction().getText());
assertEquals(0, labeledAction.getComments().size());
labeledAction = (AAction) actions.get(1);
assertEquals("act2", labeledAction.getName().getText());
assertEquals("skip", labeledAction.getAction().getText());
assertNotNull(labeledAction.getComments());
assertEquals("MyComment@act2", labeledAction.getComments().get(0).getText());
}
use of de.be4.eventbalg.core.parser.node.AAction in project probparsers by bendisposto.
the class CommentTest method testAtSignInComment.
@Test
public void testAtSignInComment() throws Exception {
final Start rootNode = parseInput("machine AtSignInComment\nevents\nevent testEvent\nthen\n@act1 skip\n@act2 skip\n// MyComment@act2\nend\nend", false);
final AMachineParseUnit parseUnit = (AMachineParseUnit) rootNode.getPParseUnit();
final AEvent event = (AEvent) parseUnit.getEvents().get(0);
final LinkedList<PAction> actions = event.getActions();
AAction labeledAction = (AAction) actions.get(0);
assertEquals("act1", labeledAction.getName().getText());
assertEquals("skip", labeledAction.getAction().getText());
assertEquals(0, labeledAction.getComments().size());
labeledAction = (AAction) actions.get(1);
assertEquals("act2", labeledAction.getName().getText());
assertEquals("skip", labeledAction.getAction().getText());
assertNotNull(labeledAction.getComments());
assertEquals("MyComment@act2", labeledAction.getComments().get(0).getText());
}
Aggregations