Search in sources :

Example 1 with ValidationTestHelper

use of org.eclipse.xtext.testing.validation.ValidationTestHelper in project context-mapper-dsl by ContextMapper.

the class ParsingErrorAssertions method assertThatNoValidationErrorsOccurred.

public static void assertThatNoValidationErrorsOccurred(EObject parsingResultObject) {
    ValidationTestHelper helper = new ValidationTestHelper();
    helper.assertNoErrors(parsingResultObject);
}
Also used : ValidationTestHelper(org.eclipse.xtext.testing.validation.ValidationTestHelper)

Example 2 with ValidationTestHelper

use of org.eclipse.xtext.testing.validation.ValidationTestHelper in project context-mapper-dsl by ContextMapper.

the class UniquenessAcrossFilesTest method canValidateUniquenessAcrossFiles.

@Test
public void canValidateUniquenessAcrossFiles() throws IOException {
    // given
    CMLResource input = getOriginalResourceOfTestCML("uniqueness-validation-test.cml");
    // when, then
    new ValidationTestHelper().assertError(input.getXtextResource(), ContextMappingDSLPackage.Literals.BOUNDED_CONTEXT, "", String.format(BOUNDED_CONTEXT_NAME_NOT_UNIQUE, "anotherContext"));
}
Also used : ValidationTestHelper(org.eclipse.xtext.testing.validation.ValidationTestHelper) CMLResource(org.contextmapper.dsl.cml.CMLResource) Test(org.junit.jupiter.api.Test)

Aggregations

ValidationTestHelper (org.eclipse.xtext.testing.validation.ValidationTestHelper)2 CMLResource (org.contextmapper.dsl.cml.CMLResource)1 Test (org.junit.jupiter.api.Test)1