diff --git a/.gitignore b/.gitignore index e525f934c..206230fc5 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,8 @@ dspot/src/test/resources/mockito/log/ dspot/src/test/resources/multiple-pom/module-1/module-2-1/log/ dspot/src/test/resources/sample/log/ dspot/src/test/resources/test-projects/log/ +dspot/src/test/resources/.gradle/ +dspot/src/test/resources/gradle/ dspot/src/test/resources/mockito/.dspot_pom.xml dspot/src/test/resources/multiple-pom/module-1/module-2-1/.dspot_pom.xml dspot/src/test/resources/project-with-resources/.dspot_pom.xml diff --git a/README.md b/README.md index 0853e06d8..5b26d2499 100644 --- a/README.md +++ b/README.md @@ -113,8 +113,10 @@ Amplify a specific test method from a specific test class ```bash java -jar /path/to/dspot-LATEST-jar-with-dependencies.jar --absolute-path-to-project-root --test my.package.TestClass --cases testMethod ``` + ### Command line options -### Command line options +
+ Full list of command line options ``` Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--dev-friendly] [--example] @@ -339,7 +341,9 @@ Usage: eu.stamp_project.Main [-hvV] [--allow-path-in-assertions] [--clean] [--de Enable comment on amplified test: details steps of the amplification. Valid values: All, Amplifier, Coverage, None. Default value: None ``` - + +
+ For options that take list, the used separator is a comma `,`, whatever the platform you use. ### Maven plugin usage @@ -403,7 +407,7 @@ For now, there are three implementations of the Input Ampl Distributor: * `SimpleInputAmplDistributor`: This distributor selects a fair number of amplified test method per Amplifier per test methods, if possible. The total budget is specified by the command line option ``--max-test-amplified`, and is the total number of amplified test methods to keep, _i.e._ it will be divide by the number of Amplifiers and by the number of test methods to be amplified. Example: We have 2 Amplifiers. We apply them to 2 test methods. For each test methods, amplifiers generate 4 new test methods, totally 8 amplified test methods. If the budget is 6, it will select: 3 amplified test methods per amplifier, and 2 for one test method and 2 for the other. -#### Supported Features +#### Supported Test Frameworks DSpot supports: @@ -421,6 +425,19 @@ Please, do not amplify test classes that mix test frameworks (test methods in JU If you have such test class, please amplify the different test framework separately. +#### Supported JDKs & Build Tools + +DSpot runs with the following Java versions: + +* Java 1.8 +* Java 11 +* Java 16 (used as JDK, not tested if it can support Java 16 language features) + +It can amplify tests of projects built with: + +* Maven 3.6 +* Gradle 7 + ## Minimizing and Prettifying DSpot Amplified Test Cases With the [DSpot Prettifier](dspot-prettifier) you can remove redundant assertions from your amplified test cases & give them more expressive names with the help of code2vec and context2vec. diff --git a/dspot/pom.xml b/dspot/pom.xml index 1c27b90a7..1979a28e9 100644 --- a/dspot/pom.xml +++ b/dspot/pom.xml @@ -231,7 +231,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.7.0 + 3.8.1 1.8 1.8 @@ -248,7 +248,7 @@ eu.stamp_project.Main - true + true diff --git a/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleInjector.java b/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleInjector.java index 115a75582..905ad53e4 100644 --- a/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleInjector.java +++ b/dspot/src/main/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleInjector.java @@ -137,9 +137,11 @@ void resetOriginalGradleBuildFile(String pathToRootOfProject) { private String getPrintClasspathTask() { return AmplificationHelper.LINE_SEPARATOR + AmplificationHelper.LINE_SEPARATOR + - "task " + WRITE_CLASSPATH_TASK + " << { " + AmplificationHelper.LINE_SEPARATOR + - " buildDir.mkdirs() " + AmplificationHelper.LINE_SEPARATOR + - " new File(buildDir, \"classpath.txt\").text = configurations.testCompile.asPath " + AmplificationHelper.LINE_SEPARATOR + + "task " + WRITE_CLASSPATH_TASK + " {" + AmplificationHelper.LINE_SEPARATOR + + " doLast { " + AmplificationHelper.LINE_SEPARATOR + + " buildDir.mkdirs() " + AmplificationHelper.LINE_SEPARATOR + + " new File(buildDir, \"classpath.txt\").text = configurations.testCompileClasspath.asPath " + AmplificationHelper.LINE_SEPARATOR + + " }" + AmplificationHelper.LINE_SEPARATOR + "}" + AmplificationHelper.LINE_SEPARATOR; } diff --git a/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderTest.java b/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderTest.java index 487746716..a06f8d502 100644 --- a/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderTest.java +++ b/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderTest.java @@ -46,7 +46,7 @@ public class GradleAutomaticBuilderTest { @Before public void setUp() throws Exception { - assumeTrue("true".equals(System.getProperty("doIntegrationTests"))); + //assumeTrue("true".equals(System.getProperty("doIntegrationTests"))); DSpotState.verbose = true; cleanTestEnv(); LOGGER.debug("Test Set-up - Reading input parameters..."); @@ -72,7 +72,6 @@ public void tearDown() throws Exception { LOGGER.debug("Test Tear-down complete."); } - @Ignore @Test public void compile_whenCleanCompileTestTasksAreAppliedToDSpotTestExampleProject() throws Exception { LOGGER.info("Starting Gradle Automatic Builder compile() test..."); @@ -82,7 +81,6 @@ public void compile_whenCleanCompileTestTasksAreAppliedToDSpotTestExampleProject LOGGER.info("Gradle Automatic Builder compile() test complete."); } - @Ignore @Test public void buildClasspath_whenAppliedToDSpotTestExampleProject() throws Exception { LOGGER.info("Starting Gradle Automatic Builder buildClasspath() test..."); @@ -100,7 +98,6 @@ public void buildClasspath_whenAppliedToDSpotTestExampleProject() throws Excepti LOGGER.info("Gradle Automatic Builder buildClasspath() test complete."); } - @Ignore @Test public void runPit_whenNoTestClassIsSpecified() throws Exception { LOGGER.info("Starting Gradle Automatic Builder runPit() test when no test class is specified..."); @@ -112,7 +109,7 @@ public void runPit_whenNoTestClassIsSpecified() throws Exception { LOGGER.info("Gradle Automatic Builder runPit() test complete when no test class is specified."); } - @Ignore + @Test public void runPit_whenTestClassIsSpecified() throws Exception { LOGGER.info("Starting Gradle Automatic Builder runPit() test when a test class is specified..."); diff --git a/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderWithDescartesTest.java b/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderWithDescartesTest.java index 45082a534..0167301ae 100644 --- a/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderWithDescartesTest.java +++ b/dspot/src/test/java/eu/stamp_project/dspot/common/automaticbuilder/gradle/GradleAutomaticBuilderWithDescartesTest.java @@ -67,7 +67,6 @@ public void tearDown() throws Exception { LOGGER.debug("Test Tear-down complete."); } - @Ignore @Test public void runPit_whenAllDescartesMutatorsAreSpecified() throws Exception { LOGGER.info("Starting Gradle Automatic Builder runPit() test when a test class is specified..."); diff --git a/dspot/src/test/resources/sample/pom.xml b/dspot/src/test/resources/sample/pom.xml index 1a7aec526..072dcc456 100644 --- a/dspot/src/test/resources/sample/pom.xml +++ b/dspot/src/test/resources/sample/pom.xml @@ -65,7 +65,7 @@ org.projectlombok lombok - 1.18.4 + 1.18.20 provided diff --git a/dspot/src/test/resources/test-projects/build.gradle b/dspot/src/test/resources/test-projects/build.gradle index 987485d11..32ed9852a 100644 --- a/dspot/src/test/resources/test-projects/build.gradle +++ b/dspot/src/test/resources/test-projects/build.gradle @@ -14,7 +14,7 @@ repositories { } dependencies { - compile 'org.apache.logging.log4j:log4j-api:2.8.2' - compile 'org.apache.logging.log4j:log4j-core:2.8.2' - testCompile 'junit:junit:4.12' + implementation 'org.apache.logging.log4j:log4j-api:2.8.2' + implementation 'org.apache.logging.log4j:log4j-core:2.8.2' + testImplementation 'junit:junit:4.12' } \ No newline at end of file