diff --git a/.travis/travis-prettifier.sh b/.travis/travis-prettifier.sh index 72d9ff8f9..9ce6a38d9 100755 --- a/.travis/travis-prettifier.sh +++ b/.travis/travis-prettifier.sh @@ -4,6 +4,6 @@ source /opt/jdk_switcher/jdk_switcher.sh ./dspot-prettifer/src/test/bash/install_code2vec.sh -jdk_switcher use openjdk8 & mvn -Djava.src.version=1.8 test -f dspot-prettifier/pom.xml - pip3 install bottleneck numpy keras tensorflow + +jdk_switcher use openjdk8 & mvn -Djava.src.version=1.8 test -f dspot-prettifier/pom.xml diff --git a/README.md b/README.md index b417031a1..91c2e7952 100644 --- a/README.md +++ b/README.md @@ -128,45 +128,7 @@ java -jar /path/to/dspot-LATEST-jar-with-dependencies.jar --path-to-properties d ### Maven plugin usage -You can execute DSpot using the maven plugin. You can use this plugin on the command line as the jar: - -```bash -# this amplifies the Junit tests to kill more mutants -mvn eu.stamp-project:dspot-maven:amplify-unit-tests - -# this amplifies the Junit tests to improve coverage -mvn eu.stamp-project:dspot-maven:amplify-unit-tests -Dtest-criterion=JacocoCoverageSelector - -``` - -All the option can be pass through command line by prefixing the option with `-D`. -For example: - -```bash -mvn eu.stamp-project:dspot-maven:amplify-unit-tests -Dpath-to-properties=dspot.properties -Dtest=my.package.TestClass -Dcases=testMethod -``` - -or, you can add the following to your `pom.xml`, in the plugins section of the build: - -```xml - - eu.stamp-project - dspot-maven - LATEST - - - - -``` -Replace `LATEST` with the latest DSpot version number available at Maven central: `2.0.0` - -In case your project is a multi-module, we advise you to configure DSpot in the highest `pom.xml` and use the dedicated property `targetModule` to name the module you want to amplify - -After setting up your `pom.xml` and add your configuration with different options,run: - -```bash -mvn dspot:amplify-unit-tests -``` +You can execute DSpot using the maven plugin. For more details, see the dedicated [README](https://github.com/STAMP-project/dspot/blob/master/dspot-maven/README.md). ### Command line options diff --git a/dspot-maven/README.md b/dspot-maven/README.md new file mode 100644 index 000000000..7665ce0ee --- /dev/null +++ b/dspot-maven/README.md @@ -0,0 +1,51 @@ +# DSpot-Maven + +You can use this plugin on the command line as the jar: + +```bash +# this amplifies the Junit tests to kill more mutants +mvn eu.stamp-project:dspot-maven:amplify-unit-tests + +# this amplifies the Junit tests to improve coverage +mvn eu.stamp-project:dspot-maven:amplify-unit-tests -Dtest-criterion=JacocoCoverageSelector + +``` + +All the option can be pass through command line by prefixing the option with `-D`. +For example: + +```bash +mvn eu.stamp-project:dspot-maven:amplify-unit-tests -Dpath-to-properties=dspot.properties -Dtest=my.package.TestClass -Dcases=testMethod +``` + +or, you can add the following to your `pom.xml`, in the plugins section of the build: + +```xml + + eu.stamp-project + dspot-maven + LATEST + + + + +``` +Replace `LATEST` with the latest DSpot version number available at Maven central: `2.0.0` + +In case your project is a multi-module, we advise you to configure DSpot in the highest `pom.xml` and use the dedicated property `targetModule` to name the module you want to amplify + +After setting up your `pom.xml` and add your configuration with different options,run: + +```bash +mvn dspot:amplify-unit-tests +``` + +# Advantages + +The advantages of using the maven plugin is that maven will automatically the latest version deployed on maven central, even the SNAPSHOT built at each commits on the master! + +Second, is that the properties is optional and the maven-plugin to automatically infer from the pom.xml some required information such as the path of the project root directory. + +**!! WARNING !!** Since DSpot can be executed on one module at the time, we advise you to the same with the maven plugin by using the dedicated command line option `-DtargetModule=`. + +The best way is to execute dspot-maven on the parent project and specifying the targeted module using the options mentioned above. In this way, DSpot will be able to collect all the dependencies. \ No newline at end of file diff --git a/dspot-prettifier/src/test/java/eu/stamp_project/prettifier/context2name/Context2NameTest.java b/dspot-prettifier/src/test/java/eu/stamp_project/prettifier/context2name/Context2NameTest.java index 2a24d1d89..3e852342d 100644 --- a/dspot-prettifier/src/test/java/eu/stamp_project/prettifier/context2name/Context2NameTest.java +++ b/dspot-prettifier/src/test/java/eu/stamp_project/prettifier/context2name/Context2NameTest.java @@ -2,6 +2,7 @@ import eu.stamp_project.prettifier.Main; import eu.stamp_project.utils.AmplificationHelper; +import org.junit.Ignore; import org.junit.Test; import spoon.Launcher; import spoon.reflect.declaration.CtClass; @@ -15,6 +16,8 @@ import static org.junit.Assert.assertThat; public class Context2NameTest { + + @Ignore @Test public void testContext2Name() { String codeStr = "import spoon.Launcher;" + AmplificationHelper.LINE_SEPARATOR +