public abstract class AbstractTestRunner
extends java.lang.Object
Runs JUnit4
test cases against a given set of AbstractMutant
s.
The execution is done by saving the compiled code of AbstractMutant
to Constants.TMP
and then executing a OS dependent command to execute
provided test suite.
As Windows, Linux and MacOs commands vary, this class should be extended to implement
the intended OS command by overriding getCommand(String)
After executing test suites the result is matched using Pattern
to recognize
exceptions thrown by JUnit4
. The header of the exceptions thrown are stored
in the AbstractMutant
using AbstractMutant.addKilledBy(String)
.
This class is not intended to be accessed directly, to run test cases use TestExecutor
.
TestExecutor
,
LinuxTestRunner
,
WindowsTestRunner
Constructor and Description |
---|
AbstractTestRunner() |
Modifier and Type | Method and Description |
---|---|
<T extends AbstractMutant> |
execute(java.util.List<T> mutants,
java.lang.String originalFile,
java.lang.String testCasesPath,
java.util.Set<MessageListener> messageListeners) |
<T extends AbstractMutant> |
execute(Population<T> population,
java.lang.String originalFile,
java.lang.String testCasesPath,
java.util.Set<MessageListener> messageListeners) |
abstract java.lang.String |
getCommand(java.lang.String testSuites) |
public final <T extends AbstractMutant> void execute(Population<T> population, java.lang.String originalFile, java.lang.String testCasesPath, java.util.Set<MessageListener> messageListeners)
T
- The type of Population
.population
- to be executed against test suites got from getTestSuites(String)
originalFile
- file underExecutiontestCasesPath
- path to test casesmessageListeners
- for loggingpublic final <T extends AbstractMutant> void execute(java.util.List<T> mutants, java.lang.String originalFile, java.lang.String testCasesPath, java.util.Set<MessageListener> messageListeners)
T
- The type of Population
.mutants
- to be executed against test suites got from getTestSuites(String)
originalFile
- file underExecutiontestCasesPath
- path to test casesmessageListeners
- for loggingpublic abstract java.lang.String getCommand(java.lang.String testSuites)
testSuites
- providedJUnit4
test execution command