[EUnit] assertEqualModels fails on model with applied UML profile [message #1697765] |
Mon, 08 June 2015 09:28 |
Rene Meis Messages: 19 Registered: June 2015 |
Junior Member |
|
|
Hi,
I want to use EUnit to test my model transformations and ideally would like to use the built-in model comparison based on EMF compare instead of programming the comparison on my own.
I use UML models enhanced with registered UML profiles and I think this is where my problem is located. Even if I try to compare a model with an applied profile with itself, the comparison with assertEqualModels fails. Randomly, I get an error stating
Test simpleTest {} failed with status ERROR: Internal error: Internal error: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'annotation' not found. [file:/tmp/emf-model-comparator-clone-UML.metamodel.uml.6872184734644465963.model, 17774, 17]
...
Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'annotation' not found. [file:/tmp/emf-model-comparator-clone-UML.metamodel.uml.6872184734644465963.model, 17774, 17]
...
or the test fails with
Test simpleTest {} failed with status FAILURE: Internal error: Expected Model to be equal to Expected, but it is not
and the difference shown by EMF compare is "appliedProfile changed".
I attached a minimal example. With the launch script
<project default="uml-tests">
<target name="uml-tests">
<epsilon.eunit src="uml.eunit">
<modelTasks>
<epsilon.emf.loadModel name="Model"
modelfile="source.uml"
metamodeluri="http://www.eclipse.org/uml2/2.0.0/UML"
read="true" store="false"/>
<epsilon.emf.loadModel name="Expected"
modelfile="source.uml"
metamodeluri="http://www.eclipse.org/uml2/2.0.0/UML"
read="true" store="false"/>
</modelTasks>
</epsilon.eunit>
</target>
</project>
and the test script
@test
operation simpleTest() {
assertEqualModels("Expected", "Model");
}
Best regards,
Rene
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03220 seconds