use of org.eclipse.emf.ecore.EValidator in project xtext-core by eclipse.
the class Bug367679Test method assertValidatorExists.
protected void assertValidatorExists() {
EValidator eValidator = EValidator.Registry.INSTANCE.getEValidator(XtextPackage.eINSTANCE);
Assert.assertNotNull(eValidator);
Assert.assertTrue(eValidator instanceof CompositeEValidator);
}
use of org.eclipse.emf.ecore.EValidator in project xtext-core by eclipse.
the class AbstractCompositeValidatorTest method testBug_279962.
@Test
public void testBug_279962() {
EValidator validator = registry.getEValidator(pack);
assertTrue(validator instanceof CompositeEValidator);
CompositeEValidator composite = (CompositeEValidator) validator;
int prevSize = composite.getContents().size();
get(Val_279962_01.class);
get(Val_279962_04.class);
assertEquals(prevSize + 2, composite.getContents().size());
assertNotNull(validator);
Resource resource = get(XtextResource.class);
Model model = EnumRulesTestLanguageFactory.eINSTANCE.createModel();
resource.getContents().add(model);
// do not expect an exception
validator.validate(model, new BasicDiagnostic(), null);
assertEquals(prevSize + 4, composite.getContents().size());
}
use of org.eclipse.emf.ecore.EValidator in project xtext-core by eclipse.
the class CompositeValidatorWithEObjectValidatorTest method testContentsSize.
@Override
@Test
public void testContentsSize() {
EValidator validator = registry.getEValidator(pack);
assertNotNull(validator);
assertTrue(validator instanceof CompositeEValidator);
CompositeEValidator composite = (CompositeEValidator) validator;
Collection<EValidatorEqualitySupport> contents = composite.getContents();
assertEquals(3, contents.size());
}
use of org.eclipse.emf.ecore.EValidator in project xtext-core by eclipse.
the class CompositeValidatorWithoutEObjectValidatorTest method testContentsSize.
@Override
@Test
public void testContentsSize() {
EValidator validator = registry.getEValidator(pack);
assertNotNull(validator);
assertTrue(validator instanceof CompositeEValidator);
CompositeEValidator composite = (CompositeEValidator) validator;
Collection<EValidatorEqualitySupport> contents = composite.getContents();
assertEquals(2, contents.size());
}
Aggregations