Package caseine.extra.utils.mutations
Class DynamicTestExecutor
java.lang.Object
caseine.extra.utils.mutations.DynamicTestExecutor
- Direct Known Subclasses:
DynamicTestExecutorImpl4,DynamicTestExecutorImpl5
This class is introduced to run dynamically classes of tests. It is
specifically used in the problems of tests by mutation (cf. Lab on mutants).
- Author:
- Christophe Saint-Marcel <christophe.saint-marcel@univ-grenoble-alpes.fr>
-
Constructor Summary
ConstructorsConstructorDescriptionDynamicTestExecutor(String testClass, String newPackageName) Construct the executor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidRemove tmp directory.protected Path[]compileSources(Path[] javaFiles) Compile sources.abstract booleandoTest()Play now a single test.protected String[]Read sources.protected StringreplacePackaging(String testName, String src) Change the package to reference the mutant.protected Path[]saveSources(String[] sources, String[] classNames) Save the source files.
-
Constructor Details
-
DynamicTestExecutor
Construct the executor.- Parameters:
testClass- class of testnewPackageName- location of the mutant- Throws:
FileNotFoundException
-
-
Method Details
-
readCodes
Read sources.- Parameters:
classNames-- Returns:
- Throws:
FileNotFoundException
-
saveSources
Save the source files.- Parameters:
sources- codesclassNames-- Returns:
- Throws:
IOException
-
compileSources
Compile sources.- Parameters:
javaFiles-- Returns:
-
doTest
Play now a single test.- Returns:
- number of failures
- Throws:
Exception
-
replacePackaging
Change the package to reference the mutant.- Parameters:
testName- name of the class with its packagessrc- the source to modify- Returns:
- the modified source
-
cleanClassPath
protected void cleanClassPath()Remove tmp directory.
-