This service is archived, please use www.eclipse.org/forums


Home » Capella » Capella Studio » How to unit test diagram related operations ? (I've been trying to unit test diagram operations but its fails has I got no diagram open)
How to unit test diagram related operations ? [message #3629] Thu, 31 October 2019 04:26
MehdiBelatrous is currently offline  MehdiBelatrous
Messages: 8
Registered: July 2019
Location: Erlangen
Junior Member
Hi everyone,

I'm currently trying to test (with JUnit) my viewpoint code. For example, I want to test below method.
ExecutionManager manager = Utils.getExecutionManager(eObject);
manager.execute(new AbstractReadWriteCommand(){
	@Override
	public void run() {
		componentExchange.getAppliedPropertyValues().add(except);
		resource.getContents().add((EObject) except);
	}
});



However this test will fail because ExecutionManager is null has no Sirius session is loaded and no diagram is open. Searching Eclipse Sirius forum I found this topic advising to make test class extend SiriusDiagramTestCase. So I installed Sirius test suite and did so. However though I understand that setup and genericSetup method are the keys, I dont know how to properly use them (mine just hang up indefinitly) and I searched a bit in Sirius tests but could not find suitable code.

Can someone point me in the right direction ? Thanks in advance for any help.
Previous Topic: XText grammar generation issue in Capella Studio
Next Topic: getName() method ?
Goto Forum:
  


Current Time: Sat Mar 28 04:36:38 EST 2020

Total time taken to generate the page: 0.01419 seconds