Sync git svn branch with SVN repository r33290.
[simantics/platform.git] / bundles / org.simantics.tests.modelled.ui / src / org / simantics / tests / modelled / ui / TestsUIUtils.java
1 package org.simantics.tests.modelled.ui;\r
2 \r
3 import java.io.IOException;\r
4 \r
5 import org.eclipse.e4.ui.model.application.ui.basic.MPart;\r
6 import org.simantics.db.Resource;\r
7 import org.simantics.db.exception.DatabaseException;\r
8 import org.simantics.ui.workbench.e4.E4WorkbenchUtils;\r
9 \r
10 public class TestsUIUtils {\r
11 \r
12     private TestsUIUtils() {\r
13     }\r
14 \r
15     public static void runSTSTestAction(Resource test) throws DatabaseException, IOException {\r
16         MPart part = E4WorkbenchUtils.getMPartById(STSTestRunnerView.ID);\r
17         E4WorkbenchUtils.openAndShowPart(part);\r
18         Object obj = part.getObject();\r
19         STSTestRunnerView view = (STSTestRunnerView) obj;\r
20         view.currentTest(test);\r
21         view.execute();\r
22     }\r
23 }\r