Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » JUnit-tests for property views
JUnit-tests for property views [message #1802760] Fri, 15 February 2019 09:50 Go to next message
Tjalling Ran is currently offline Tjalling RanFriend
Messages: 4
Registered: February 2019
Junior Member
For testing functionality of our Sirius-based editor, we let our test classes derive from This is very useful for, e.g., applying tools from the palette and checking properties on sessions.

Besides the diagram, our .odesign specifies property pages as well. Is there functionality available for (a) selecting a model element on the diagram and then (b) testing the corresponding property pages' text fields, buttons, etc (similar to applying palette tools using SiriusDiagramTestCase)?

We'd like to avoid testing our property pages using RCPTT or by, e.g, manually obtaining EditParts on the property pages and manipulating these.
Re: JUnit-tests for property views [message #1802774 is a reply to message #1802760] Fri, 15 February 2019 13:46 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 554
Registered: July 2009
Senior Member

For (a), there should be no issue with programmatically selecting an element on a diagram. You can use for example, List<DRepresentationElement>) or, List<DRepresentationElement>). Just make sure to wait for the selection to take effect (using for example

For (b) however, there is no API to introspect/manipulate the contents of the properties views. Our own tests in Sirius for these are made using RCPTT. Depending on your case, there is one possible workaround which would allow you to obtain the EMF model that Sirius produces and gives to the EEF runtime which describes the structure of the properties view, and that you can then check. This however does not test the UI part where the EEF runtime renders the actual SWT widgets from this description.

The general idea for this workaround is:

  • Get the which is currently displayed by the "Properties" view, using the standard Eclipse APIs. If your properties view is produced by Sirius/EEF, it will be an Let's call it "page"
  • page.getCurrentTab().getSections() will give you the the correspond to the widget groups in the page. In practice there will be only one for properties views produced by Sirius/EEF.
  • Here you need to cast the IEEFSection into and use Java reflection to read its "private EEFTab tab" field. Unfortunately there is currently no API to access this. You can use Sirius's, String) for this if you want.
  • Once you have the org.eclipse.eef.ide.ui.api.EEFTab, tab.getEEFPage().getDescription() will give you the org.eclipse.eef.EEFPageDescription which is the root of the EMF model that describes the whole structure of the properties page.


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
Re: JUnit-tests for property views [message #1802897 is a reply to message #1802774] Mon, 18 February 2019 17:05 Go to previous message
Tjalling Ran is currently offline Tjalling RanFriend
Messages: 4
Registered: February 2019
Junior Member
Thank you for the elaborate answer. I wasn't aware of the DialectUIServices, very useful to know. For the EEFPageDescription, I've put an item on our backlog, as that seems definitely worth trying.
Previous Topic:[ANN] Sirius 6.1.2
Next Topic:Sirius to visio
Goto Forum:

Current Time: Sun Jan 17 14:22:57 GMT 2021

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

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

Back to the top