X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.tests.modelled%2Fsrc%2Forg%2Fsimantics%2Ftests%2Fmodelled%2Fjunit%2FRuntimeSTSRunner.java;h=2311409f8f236699b47834d57d83d1f9ccf598dc;hp=e85d2f7d7925bf384aa386c2b35bf45c99fb9dd3;hb=96882721770c5943a857503e8c6fed334fe3f214;hpb=1b4d8b692f40d946deb5db8280eb4ca5b36a75a7 diff --git a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/junit/RuntimeSTSRunner.java b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/junit/RuntimeSTSRunner.java index e85d2f7d7..2311409f8 100644 --- a/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/junit/RuntimeSTSRunner.java +++ b/bundles/org.simantics.tests.modelled/src/org/simantics/tests/modelled/junit/RuntimeSTSRunner.java @@ -1,51 +1,49 @@ -package org.simantics.tests.modelled.junit; - -import java.util.List; - -import org.junit.runner.Description; -import org.junit.runner.Result; -import org.junit.runner.Runner; -import org.junit.runner.notification.Failure; -import org.junit.runner.notification.RunListener; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.ParentRunner; - -public abstract class RuntimeSTSRunner extends ParentRunner { - - public RuntimeSTSRunner(Class testClass) throws Exception { - super(testClass); - } - - public abstract void initialize() throws Exception; - - public abstract void deinitialize() throws Exception; - - @Override - protected Description describeChild(Runner child) { - return child.getDescription(); - } - - @Override - public void run(RunNotifier notifier) { - notifier.addListener(new RunListener() { - - @Override - public void testRunFinished(Result result) throws Exception { - deinitialize(); - } - }); - super.run(notifier); - } - - @Override - protected void runChild(Runner child, RunNotifier notifier) { - Description desc = describeChild(child); - notifier.fireTestStarted(desc); - try { - child.run(notifier); - notifier.fireTestFinished(desc); - } catch (Throwable e) { - notifier.fireTestFailure(new Failure(desc, e)); - } - } -} +package org.simantics.tests.modelled.junit; + +import org.junit.runner.Description; +import org.junit.runner.Result; +import org.junit.runner.Runner; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.ParentRunner; + +public abstract class RuntimeSTSRunner extends ParentRunner { + + public RuntimeSTSRunner(Class testClass) throws Exception { + super(testClass); + } + + public abstract void initialize() throws Exception; + + public abstract void deinitialize() throws Exception; + + @Override + protected Description describeChild(Runner child) { + return child.getDescription(); + } + + @Override + public void run(RunNotifier notifier) { + notifier.addListener(new RunListener() { + + @Override + public void testRunFinished(Result result) throws Exception { + deinitialize(); + } + }); + super.run(notifier); + } + + @Override + protected void runChild(Runner child, RunNotifier notifier) { + Description desc = describeChild(child); + notifier.fireTestStarted(desc); + try { + child.run(notifier); + notifier.fireTestFinished(desc); + } catch (Throwable e) { + notifier.fireTestFailure(new Failure(desc, e)); + } + } +}