running validation from an application (or a junit test) [message #412679] |
Sun, 02 September 2007 15:02 |
|
Hi
I was trying to run validation from an application (also tried from a
junit test) using the extlibrary example, with the following code:
EXTLibraryFactory factory = EXTLibraryFactory.eINSTANCE;
Library library = factory.createLibrary();
Book book = factory.createBook();
book.setTitle("foo");
library.getBooks().add(book);
System.out.println("book: " + book);
IBatchValidator validator = (IBatchValidator) ModelValidationService
.getInstance().newValidator(EvaluationMode.BATCH);
IStatus status = validator.validate(library);
System.out.println("result: " + status);
but I get the following error:
Exception in thread "main" java.lang.ExceptionInInitializerError
at
org.eclipse.emf.validation.internal.service.BatchValidator$D efaultRecursiveTraversalStrategy.initDelegates(BatchValidato r.java:338)
at
org.eclipse.emf.validation.internal.service.BatchValidator$D efaultRecursiveTraversalStrategy.startTraversal(BatchValidat or.java:259)
at
org.eclipse.emf.validation.internal.service.BatchValidator.v alidate(BatchValidator.java:169)
at
org.eclipse.emf.validation.internal.service.BatchValidator.d oValidate(BatchValidator.java:137)
at
org.eclipse.emf.validation.internal.service.AbstractValidato r.validate(AbstractValidator.java:141)
at
org.eclipse.emf.validation.internal.service.AbstractValidato r.validate(AbstractValidator.java:120)
at
org.eclipse.emf.examples.extlibrary.tests.EXTLibraryExample. main(EXTLibraryExample.java:74)
Caused by: java.lang.NullPointerException
at
org.eclipse.emf.validation.internal.EMFModelValidationPlugin .getPluginId(EMFModelValidationPlugin.java:203)
at
org.eclipse.emf.validation.internal.service.TraversalStrateg yManager.initStrategies(TraversalStrategyManager.java:100)
at
org.eclipse.emf.validation.internal.service.TraversalStrateg yManager. <init>(TraversalStrategyManager.java:62)
at
org.eclipse.emf.validation.internal.service.TraversalStrateg yManager. <clinit>(TraversalStrategyManager.java:54)
... 7 more
what am I doing wrong?
thanks in advance
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
HOME: http://www.lorenzobettini.it
TDD Book: https://leanpub.com/tdd-buildautomation-ci
Xtext Book: https://www.packtpub.com/application-development/implementing-domain-specific-languages-xtext-and-xtend-second-edition
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03666 seconds