use of org.eclipse.xtext.junit4.validation.AssertableDiagnostics in project statecharts by Yakindu.
the class STextJavaValidatorTest method checkAnnotationArguments.
/**
* @see STextJavaValidator#checkAnnotationArguments(org.yakindu.sct.model.stext.stext.AnnotationDefinition)
*/
@Test
public void checkAnnotationArguments() {
String scope = "@CycleBased";
EObject model = super.parseExpression(scope, StatechartSpecification.class.getSimpleName());
AssertableDiagnostics validationResult = tester.validate(model);
validationResult.assertError(STextJavaValidator.ERROR_WRONG_NUMBER_OF_ARGUMENTS_CODE);
;
scope = "@EventDriven";
model = super.parseExpression(scope, StatechartSpecification.class.getSimpleName());
validationResult = tester.validate(model);
validationResult.assertOK();
}
use of org.eclipse.xtext.junit4.validation.AssertableDiagnostics in project statecharts by Yakindu.
the class TestModelsContainErrorsTest method testTestModelContainsErrors.
@Test
public void testTestModelContainsErrors() throws Exception {
AssertableDiagnostics validate = tester.validate(statechart);
// TODO: check warning in Choice.sct
if (statechart.getName().equals("Choice"))
return;
assertTrue("Testmodel " + statechart.getName() + " contains validation diagnostics", Iterables.size(validate.getAllDiagnostics()) == 0);
}
Aggregations