Running EMF Testing the Ecore Model Outside of Eclipse

I did not find anything how to test the Ecore model outside of Eclipse. Does anyone know how to do this?

+6
eclipse validation eclipse-emf eclipse-emf-ecore
source share
1 answer

Here is the skeleton of some code that I used to test the EMF model outside of Eclipse:

EValidator.Registry.INSTANCE.put(YourPackage.eINSTANCE, new YourValidator()); BasicDiagnostic diagnostics = new BasicDiagnostic(); boolean valid = true; for (EObject eo : yourResource.getContents()) { Map<Object, Object> context = new HashMap<Object, Object>(); valid &= Diagnostician.INSTANCE.validate(eo, diagnostics, context); } 

There are more settings you can do, but I hope this helps you get started.

+4
source share

All Articles