Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Load a Papyrus ModelSet programmatically
Load a Papyrus ModelSet programmatically [message #1767721] Mon, 10 July 2017 10:21 Go to next message
Marc-Florian Wendland is currently offline Marc-Florian WendlandFriend
Messages: 81
Registered: January 2013
Hi guys,

I am currently trying to write some smoke tests for transformations as JUnit Plugin tests. Therfore I need to load a Papyrus model programmatically in the same way (as if it would have been started via the UI.

The transformation is based on EMF transaction, so a transactional editing domain is required. However, even if I load all the three resources (.di, .notation. uml) into a resource set, there is no transactional editing domain set.

I am pretty sure I once found a loading facility in the Papyrus code base, that allowed me to simply add a URI and the properly loaded resource set with transactional rediting domain.

Would somebody please adivse me how to properly load the entire Papyrus ModelSet programmatically?!

Thanks a lot in advance,
Re: Load a Papyrus ModelSet programmatically [message #1767728 is a reply to message #1767721] Mon, 10 July 2017 12:01 Go to previous message
Camille Letavernier is currently offline Camille LetavernierFriend
Messages: 864
Registered: February 2011
Senior Member
Hi Marc-Florian,

In JUnit tests, you can use the @Rules provided in the Papyrus JUnit Utils plug-in, e.g.:

	public final ModelSetFixture modelSet = new ModelSetFixture();

	public void test() {
		ModelSet ms = modelSet.getModelSet();

Check the Javadoc of org.eclipse.papyrus.junit.utils.rules.AbstractModelFixture<T> for more details.

If you don't want to reuse the complete rule, you can reuse the implementation from these methods:



Camille Letavernier
Previous Topic:<<Trace>> Realization in Palette
Next Topic:Registering a Generated Static Profile
Goto Forum:

Current Time: Wed Mar 21 07:31:37 GMT 2018

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

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