forked from STAMP-project/dspot
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: can use pit with descartes mutation engine * test: descartes injections, checker and usage of the mutation engine * the package edu.emory is now prohibited. In DSpot, we use java.util classes * cli: removes some short flags and add descartes options * fix: removed const * ci: get and build pitest-descartes from GH * fix checkstyle property
- Loading branch information
Showing
17 changed files
with
139 additions
and
177 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
2 changes: 1 addition & 1 deletion
2
dspot/src/main/java/fr/inria/diversify/dspot/amplifier/BooleanLiteralAmplifier.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package fr.inria.diversify.mutant.descartes; | ||
|
||
import fr.inria.diversify.dspot.selector.PitMutantScoreSelector; | ||
import org.w3c.dom.Document; | ||
import org.w3c.dom.Node; | ||
import org.xml.sax.SAXException; | ||
|
@@ -15,7 +16,6 @@ | |
* [email protected] | ||
* on 24/03/17 | ||
*/ | ||
@Deprecated | ||
public class DescartesChecker { | ||
|
||
public static boolean shouldInjectDescartes(String pathToPom) { | ||
|
@@ -43,7 +43,7 @@ private static boolean checkDependency(Node root) { | |
if (dependencies == null) { | ||
return true; | ||
} | ||
final List<String> expectedValues = new ArrayList<>(Arrays.asList("org.pitest", "pitest-maven", "1.1.11")); | ||
final List<String> expectedValues = new ArrayList<>(Arrays.asList("org.pitest", "pitest-maven", PitMutantScoreSelector.pitVersion)); | ||
Optional<Node> checkDependency = getAllChildNodeNamedFrom(dependencies, "dependency").stream() | ||
.filter(dependency -> | ||
checkThatHasTheGoodDependency(dependency, expectedValues) | ||
|
@@ -95,7 +95,7 @@ private static Node getPlugin(Node root) { | |
if (plugins == null) { | ||
return null; | ||
} | ||
final List<String> expectedValues = new ArrayList<>(Arrays.asList("org.pitest", "pitest-maven", "1.1.11")); | ||
final List<String> expectedValues = new ArrayList<>(Arrays.asList("org.pitest", "pitest-maven", PitMutantScoreSelector.pitVersion)); | ||
Optional<Node> checkDependency = getChildThatHasTheGoodDependency(plugins, expectedValues, "plugin"); | ||
if (!checkDependency.isPresent()) { | ||
return null; | ||
|
@@ -109,7 +109,7 @@ private static Optional<Node> getChildThatHasTheGoodDependency(Node parent, List | |
.filter(plugin -> | ||
checkThatHasTheGoodDependency(plugin, expectedValues) | ||
) | ||
.findFirst(); | ||
.findFirst(); | ||
} | ||
|
||
private static boolean checkPlugin(Node root) { | ||
|
@@ -134,7 +134,7 @@ private static boolean checkPlugin(Node root) { | |
return true; | ||
} | ||
|
||
final List<String> expectedValues = new ArrayList<>(Arrays.asList("fr.inria.stamp", "descartes", "0.1-SNAPSHOT")); | ||
final List<String> expectedValues = new ArrayList<>(Arrays.asList("fr.inria.stamp", "descartes", PitMutantScoreSelector.descartesVersion)); | ||
return !getChildThatHasTheGoodDependency(dependencies1, expectedValues, "dependency").isPresent(); | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package fr.inria.diversify.mutant.descartes; | ||
|
||
import fr.inria.diversify.dspot.selector.PitMutantScoreSelector; | ||
import fr.inria.diversify.mutant.pit.MavenPitCommandAndOptions; | ||
import org.w3c.dom.*; | ||
import org.xml.sax.SAXException; | ||
|
||
|
@@ -22,11 +24,8 @@ | |
* [email protected] | ||
* on 23/03/17 | ||
*/ | ||
@Deprecated | ||
public class DescartesInjector { | ||
|
||
private final static String[] mutators = {"null", "void", "0", "false"}; | ||
|
||
private static Node getNodeNamedFromOrBuildIfDoesnotExist(Document doc, Node startNode, String name) { | ||
Node currentNode = DescartesChecker.getNodeNamedFrom(startNode, name); | ||
if (currentNode == null) { | ||
|
@@ -49,21 +48,21 @@ private static List<Node> buildNodesDependency(Document doc, String groupIdValue | |
|
||
private static Node buildDependencyToPitTest(Document doc) { | ||
final Element dependency = doc.createElement("dependency"); | ||
buildNodesDependency(doc, "org.pitest", "pitest-maven", "1.1.11").forEach(dependency::appendChild); | ||
buildNodesDependency(doc, "org.pitest", "pitest-maven", PitMutantScoreSelector.pitVersion).forEach(dependency::appendChild); | ||
return dependency; | ||
} | ||
|
||
private static Node buildPlugin(Document doc) { | ||
final Element plugin = doc.createElement("plugin"); | ||
buildNodesDependency(doc, "org.pitest", "pitest-maven", "1.1.11").forEach(plugin::appendChild); | ||
buildNodesDependency(doc, "org.pitest", "pitest-maven", PitMutantScoreSelector.pitVersion).forEach(plugin::appendChild); | ||
plugin.appendChild(buildConfiguration(doc)); | ||
plugin.appendChild(buildDependencies(doc)); | ||
return plugin; | ||
} | ||
|
||
private static Node buildDependency(Document doc) { | ||
final Element dependency = doc.createElement("dependency"); | ||
buildNodesDependency(doc, "fr.inria.stamp", "descartes", "0.1-SNAPSHOT").forEach(dependency::appendChild); | ||
buildNodesDependency(doc, "fr.inria.stamp", "descartes", PitMutantScoreSelector.descartesVersion).forEach(dependency::appendChild); | ||
return dependency; | ||
} | ||
|
||
|
@@ -80,7 +79,7 @@ private static Node buildMutators(Document doc, String name) { | |
} | ||
|
||
private static List<Node> buildListOfMutators(Document doc) { | ||
return Arrays.stream(mutators) | ||
return Arrays.stream(MavenPitCommandAndOptions.VALUE_MUTATORS_DESCARTES) | ||
.collect(ArrayList<Node>::new, | ||
(nodes, name) -> nodes.add(buildMutators(doc, name)), | ||
ArrayList<Node>::addAll | ||
|
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
Oops, something went wrong.