-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: can now compute the baseline for a single test class * feat: add options and parameters to target one single test class * test: add a test targeting only one test class * doc: add the new option
- Loading branch information
Showing
6 changed files
with
96 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...src/test/java/eu/stamp_project/dspot/selector/OneTestClassPitScoreMutantSelectorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package eu.stamp_project.dspot.selector; | ||
|
||
import eu.stamp_project.AbstractTest; | ||
import eu.stamp_project.utils.pit.AbstractPitResult; | ||
import eu.stamp_project.utils.program.InputConfiguration; | ||
import org.junit.After; | ||
import org.junit.Test; | ||
|
||
import java.lang.reflect.Field; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
/** | ||
* created by Benjamin DANGLOT | ||
* [email protected] | ||
* on 29/01/19 | ||
*/ | ||
public class OneTestClassPitScoreMutantSelectorTest extends AbstractTest { | ||
|
||
private String FULL_QUALIFIED_NAME_TEST_CLASS = "example.TestSuiteExample"; | ||
|
||
@Override | ||
public String getPathToPropertiesFile() { | ||
return "src/test/resources/test-projects/test-projects.properties"; | ||
} | ||
|
||
@Override | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
InputConfiguration.get().setTestClasses(Collections.singletonList(FULL_QUALIFIED_NAME_TEST_CLASS)); | ||
InputConfiguration.get().setTargetOneTestClass(true); | ||
} | ||
|
||
@After | ||
public void tearDown() throws Exception { | ||
InputConfiguration.get().setTargetOneTestClass(false); | ||
InputConfiguration.get().setTestClasses(Collections.emptyList()); | ||
} | ||
|
||
@Test | ||
public void test() throws NoSuchFieldException, IllegalAccessException { | ||
final PitMutantScoreSelector pitMutantScoreSelector = new PitMutantScoreSelector(); | ||
pitMutantScoreSelector.init(InputConfiguration.get()); | ||
final Field field = pitMutantScoreSelector.getClass().getDeclaredField("originalKilledMutants"); | ||
field.setAccessible(true); | ||
List<AbstractPitResult> originalResult = (List<AbstractPitResult>) field.get(pitMutantScoreSelector); | ||
assertTrue(originalResult.stream().allMatch(abstractPitResult -> abstractPitResult.getFullQualifiedNameOfKiller().equals(FULL_QUALIFIED_NAME_TEST_CLASS))); | ||
} | ||
} |