|
|
|
|
Re: Checking invariants (embedded in Metamodel) with Diagnostician [message #856367 is a reply to message #856265] |
Wed, 25 April 2012 15:49 |
eclipsy eclipsy Messages: 6 Registered: April 2012 |
Junior Member |
|
|
Quote:
Your test code is validating the Ecore model, not the instance. Note
that the diagnostician will walk the entire containment tree so you only
need to call validate on the root object in the resource.
Yes, I actually wanted to iterate over the instance. That was typo and should be "...instance.getAllContents();"
Nevertheless, when I change that line the validation still doesn't work.
Even if I'm currently not validating only the model root there should at least
be a violation with the EObject of type A and one with the model root, I think.
My instance iteration looks now as follows (the "instanceof EOperation"-Check was
nonsense with the instance, i removed it):
Iterator<EObject> itM = instance.getAllContents();
while (itM.hasNext()) {
EObject eObject = (EObject) itM.next();
if(validateObject(eObject)==false) {
System.out.println("violated");
}
}
[Updated on: Thu, 26 April 2012 05:51] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03591 seconds