Skip to content

Commit

Permalink
Merge ac2227b into b899158
Browse files Browse the repository at this point in the history
  • Loading branch information
danglotb committed Oct 11, 2019
2 parents b899158 + ac2227b commit a794da6
Show file tree
Hide file tree
Showing 11 changed files with 249 additions and 724 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -13,7 +13,7 @@ env:
- SCRIPT=travis-oraclejdk8.sh
- SCRIPT=travis-coverage.sh
- SCRIPT=travis-jar.sh
- SCRIPT=travis-dspot-maven.sh
# - SCRIPT=travis-dspot-maven.sh
- SCRIPT=travis-checkstyle.sh
- SCRIPT=travis-dhell.sh
- SCRIPT=travis-ci-xwiki.sh
Expand Down
4 changes: 2 additions & 2 deletions .travis/travis-diff-test-selection.sh
Expand Up @@ -4,7 +4,7 @@ DPSOT_VERSION=${1}

cd dspot-diff-test-selection/src/test/resources/tavern

mvn clean eu.stamp-project:dspot-diff-test-selection:${DSPOT_VERSION}:list -Dpath-dir-second-version="../tavern-refactor" eu.stamp-project:dspot-maven:${DSPOT_VERSION}:amplify-unit-tests -Dpath-to-test-list-csv=testsThatExecuteTheChange.csv -Dverbose -Dtest-criterion=ChangeDetectorSelector -Dpath-to-properties=src/main/resources/tavern.properties -Damplifiers=NumberLiteralAmplifier -Diteration=2
mvn clean eu.stamp-project:dspot-diff-test-selection:${DSPOT_VERSION}:list -Dpath-dir-second-version="../tavern-refactor" eu.stamp-project:dspot-maven:${DSPOT_VERSION}:amplify-unit-tests -Dpath-to-test-list-csv=testsThatExecuteTheChange.csv -Dverbose -Dtest-criterion=ChangeDetectorSelector -Damplifiers=NumberLiteralAmplifier -Diteration=2 -Dabsolute-path-to-second-version=../tavern-refactor

if [ -f output/fr/inria/stamp/MainTest.java ]; then
echo "SUCCESS"
Expand All @@ -14,7 +14,7 @@ fi

rm -rf output

mvn clean eu.stamp-project:dspot-diff-test-selection:${DSPOT_VERSION}:list -Dpath-dir-second-version="../tavern-refactor" -Dpath-to-diff=patch.diff eu.stamp-project:dspot-maven:${DSPOT_VERSION}:amplify-unit-tests -Dpath-to-test-list-csv=testsThatExecuteTheChange.csv -Dverbose -Dtest-criterion=ChangeDetectorSelector -Dpath-to-properties=src/main/resources/tavern.properties -Damplifiers=NumberLiteralAmplifier -Diteration=2
mvn clean eu.stamp-project:dspot-diff-test-selection:${DSPOT_VERSION}:list -Dpath-dir-second-version="../tavern-refactor" -Dpath-to-diff=patch.diff eu.stamp-project:dspot-maven:${DSPOT_VERSION}:amplify-unit-tests -Dpath-to-test-list-csv=testsThatExecuteTheChange.csv -Dverbose -Dtest-criterion=ChangeDetectorSelector -Dabsolute-path-to-second-version=../tavern-refactor -Damplifiers=NumberLiteralAmplifier -Diteration=2

if [ -f output/fr/inria/stamp/MainTest.java ]; then
exit 0
Expand Down
2 changes: 1 addition & 1 deletion .travis/travis-dspot-maven-cmd-line.sh
Expand Up @@ -8,7 +8,7 @@ mvn install -DskipTests
cd ..

cd dspot-maven/src/test/resources/multi-module
mvn eu.stamp-project:dspot-maven:${DSPOT_VERSION}:amplify-unit-tests -Dverbose -Dpath-to-properties=multi-module.properties -Damplifiers=TestDataMutator -Diteration=1 -Dtest=example.TestSuiteExample -Dtest-criterion=JacocoCoverageSelector
mvn eu.stamp-project:dspot-maven:${DSPOT_VERSION}:amplify-unit-tests -Dtarget-module=module -Dverbose -Damplifiers=FastLiteralAmplifier -Diteration=1 -Dtest=example.TestSuiteExample -Dtest-criterion=JacocoCoverageSelector

if [ -f target/trash/example/TestSuiteExample.java ]; then
exit 0
Expand Down
29 changes: 7 additions & 22 deletions dspot-maven/README.md
Expand Up @@ -15,7 +15,7 @@ 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
mvn eu.stamp-project:dspot-maven:amplify-unit-tests -Dtest=my.package.TestClass -Dcases=testMethod
```

or, you can add the following to your `pom.xml`, in the plugins section of the build:
Expand All @@ -32,37 +32,22 @@ or, you can add the following to your `pom.xml`, in the plugins section of the b
```
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
In case your project is a multi-module, we advise you to configure DSpot in the highest `pom.xml` and use the dedicated command-line option `-DtargetModule=<Your_Module>` to name the module you want to amplify.

After setting up your `pom.xml` and add your configuration with different options,run:
After setting up your `pom.xml` and add your configuration with different options, run:

```bash
mvn dspot:amplify-unit-tests
```

# Additional Command line Options

```
-Dpath-to-test-list-csv=<path-to-csv-file>
Allow to specify a subset of test classes and test methods to be amplified in the following format:
fullQualifiedNameTestClass;testMethodsName1;testMethodsName2;...;testMethodsNameN
This file can be built by the module dspot-diff-test-selection
-Dpath-to-test-list-csv=<absolute-path-to-second-version>
To be used conjointly with the -Dtest-criterion=ChangeDetectorSelector to
specify the path to the second version of the project.
-DrunOnAllModules=<boolean>
If enable, DSpot will be executed on all modules and sub-modules with sources and test sources.
-Dtarget-module<relative-path-to-module-to-amplified>
Specify a module to be amplified. This MUST be a relative path from where you run dspot-maven.
This must be a path and not a module name.
/!\ This command-line works only if you defined DSpot in your `pom.xml`. If you do not, please use the complete command-line:

```
mvn eu.stamp-project:dspot-maven: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 are optional and the maven-plugin automatically infers from the pom.xml some required information such as the path of the project root directory.
Second, is that the maven-plugin automatically infers from the pom.xml some required information such as the path of the project root directory.
24 changes: 23 additions & 1 deletion dspot-maven/pom.xml
Expand Up @@ -57,6 +57,28 @@
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-maven-plugin</artifactId>
<version>3.2</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<processors>
<processor>
eu.stamp_project.utils.DSpotMojoGenerator
</processor>
</processors>
<withImports>true</withImports>
<enableComments>true</enableComments>
</configuration>
</plugin>
</plugins>

</build>
Expand All @@ -66,7 +88,7 @@
<dependency>
<groupId>eu.stamp-project</groupId>
<artifactId>dspot</artifactId>
<version>2.2.1</version>
<version>2.2.2-SNAPSHOT</version>
</dependency>

<dependency>
Expand Down

0 comments on commit a794da6

Please sign in to comment.