Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EUnit] assertEqualModels fails on model with applied UML profile
[EUnit] assertEqualModels fails on model with applied UML profile [message #1697765] Mon, 08 June 2015 09:28 Go to next message
Rene Meis is currently offline Rene MeisFriend
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
Re: [EUnit] assertEqualModels fails on model with applied UML profile [message #1697807 is a reply to message #1697765] Mon, 08 June 2015 14:43 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Thank you for reporting this! I'll have a look at your example and get back to you as soon as I can.
Re: [EUnit] assertEqualModels fails on model with applied UML profile [message #1697821 is a reply to message #1697807] Mon, 08 June 2015 16:06 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

I have confirmed the problem and reported it as a bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=469638

I'll push a fix to Git shortly. Do you run Epsilon from source, from an interim release, or from a pre-built Eclipse distribution?
Re: [EUnit] assertEqualModels fails on model with applied UML profile [message #1697825 is a reply to message #1697821] Mon, 08 June 2015 16:28 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

I have just pushed the fix to Git. If you're running Epsilon from source, you should be able to simply pull the fix.

Otherwise, you'll have to wait for our next interim release. I'll ask Dimitris if there's anything that would block an interim release and put out one if there isn't.
Re: [EUnit] assertEqualModels fails on model with applied UML profile [message #1697837 is a reply to message #1697825] Mon, 08 June 2015 19:14 Go to previous messageGo to next message
Rene Meis is currently offline Rene MeisFriend
Messages: 19
Registered: June 2015
Junior Member
Thank you for the swift reply.

I use Eclipse Modeling Tools with the stable Epsilon update site. If there is a fix for the bug in the interim release, I will change to the corresponding update site.
Re: [EUnit] assertEqualModels fails on model with applied UML profile [message #1697875 is a reply to message #1697837] Tue, 09 June 2015 10:10 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

I have uploaded a new interim update site. Please upgrade your Epsilon installation using this update site URL:

http://download.eclipse.org/epsilon/interim/
Re: [EUnit] assertEqualModels fails on model with applied UML profile [message #1697897 is a reply to message #1697875] Tue, 09 June 2015 12:49 Go to previous message
Rene Meis is currently offline Rene MeisFriend
Messages: 19
Registered: June 2015
Junior Member
Now my tests run as expected.

Thank you!
Previous Topic:Reading cdata from xmi model with epsilon etl
Next Topic:Serializing Models with Temporary Attributes
Goto Forum:
  


Current Time: Sat Apr 27 00:02:03 GMT 2024

Powered by FUDForum. Page generated in 0.03220 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top