From dfd68a3a50bde9c995f57c4bbdf67dab2d59524e Mon Sep 17 00:00:00 2001 From: Rene Schneider Date: Fri, 27 Sep 2013 17:36:44 +0200 Subject: [PATCH] moved initialization method into TestRunner interface --- .../integrity/runner/DefaultTestRunner.java | 23 +------------- .../de/gebit/integrity/runner/TestModel.java | 4 +-- .../de/gebit/integrity/runner/TestRunner.java | 31 +++++++++++++++++++ 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java index 57374de5c..8e6ab0f1a 100644 --- a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java +++ b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/DefaultTestRunner.java @@ -358,28 +358,7 @@ protected int getChildProcessKillTimeout() { */ protected Map> setupSuitesExecuted = new HashMap>(); - /** - * Initializes a fresh test runner instance. - * - * @param aModel - * the model to execute - * @param someParameterizedConstants - * Maps fully qualified constant names (must be those with the "parameterized" keyword) to their desired - * value. This way, test execution can be parameterized from outside. - * @param aCallback - * the callback to use to report test results - * @param aRemotingPort - * the port on which the remoting server should listen, or null if remoting should be disabled - * @param aRemotingBindHost - * the host name (or IP) to which the remoting server should bind - * @param aRandomSeed - * the seed for the {@link RandomNumberOperation} (optional; randomly determined if not given). - * @param someCommandLineArguments - * all command line arguments as given to the original Java programs' main routine (required for - * forking!) - * @throws IOException - * if the remoting server startup fails - */ + @Override public void initialize(TestModel aModel, Map someParameterizedConstants, TestRunnerCallback aCallback, Integer aRemotingPort, String aRemotingBindHost, Long aRandomSeed, String[] someCommandLineArguments) throws IOException { diff --git a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestModel.java b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestModel.java index 284211157..69b43f2b3 100644 --- a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestModel.java +++ b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestModel.java @@ -476,8 +476,8 @@ public TestRunner initializeTestRunner(TestRunnerCallback aCallback, Long aRandomSeed, String[] someCommandLineArguments) throws IOException { TestRunner tempRunner = injector.getInstance(TestRunner.class); - ((DefaultTestRunner) tempRunner).initialize(this, someParameterizedConstants, aCallback, aRemotingPort, - aRemotingBindHost, aRandomSeed, someCommandLineArguments); + tempRunner.initialize(this, someParameterizedConstants, aCallback, aRemotingPort, aRemotingBindHost, + aRandomSeed, someCommandLineArguments); return tempRunner; } diff --git a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestRunner.java b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestRunner.java index de55e2076..7b109bbbb 100644 --- a/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestRunner.java +++ b/de.gebit.integrity.runner/src/de/gebit/integrity/runner/TestRunner.java @@ -7,8 +7,12 @@ *******************************************************************************/ package de.gebit.integrity.runner; +import java.io.IOException; +import java.util.Map; + import de.gebit.integrity.dsl.SuiteDefinition; import de.gebit.integrity.dsl.VariantDefinition; +import de.gebit.integrity.runner.callbacks.TestRunnerCallback; import de.gebit.integrity.runner.results.SuiteSummaryResult; /** @@ -19,6 +23,33 @@ */ public interface TestRunner { + /** + * Initializes a fresh test runner instance. + * + * @param aModel + * the model to execute + * @param someParameterizedConstants + * Maps fully qualified constant names (must be those with the "parameterized" keyword) to their desired + * value. This way, test execution can be parameterized from outside. + * @param aCallback + * the callback to use to report test results + * @param aRemotingPort + * the port on which the remoting server should listen, or null if remoting should be disabled + * @param aRemotingBindHost + * the host name (or IP) to which the remoting server should bind + * @param aRandomSeed + * the seed for the {@link de.gebit.integrity.runner.operations.RandomNumberOperation} (optional; + * randomly determined if not given). + * @param someCommandLineArguments + * all command line arguments as given to the original Java programs' main routine (required for + * forking!) + * @throws IOException + * if the remoting server startup fails + */ + void initialize(TestModel aModel, Map someParameterizedConstants, TestRunnerCallback aCallback, + Integer aRemotingPort, String aRemotingBindHost, Long aRandomSeed, String[] someCommandLineArguments) + throws IOException; + /** * Executes a specified suite. Designated starting point for test execution. *