STAMP-project / dspot

Automatically detect and generate missing assertions for Junit test cases (also known as test amplification)
https://dspot-demo.stamp-project.eu/
GNU Lesser General Public License v3.0
114 stars 28 forks source link

Another --example error #633

Closed ltboye closed 5 years ago

ltboye commented 6 years ago

Characteristics

Description

Getting DSpot to compile on my home machine, I tried running with the --example option. "Building test-projects 0.0.1-SNAPSHOT" now seems to complete successfully, but it stops with exceptions right after. The root cause seems to be java.lang.IllegalArgumentException at org.jacoco.core.internal.Java9Support.readFully(Java9Support.java:45). Full output below.

2018-11-01 12:41:04,391 INFO eu.stamp_project.testrunner.EntryPoint - Path to runner Classes: E:\Dev\stamp\dspot\dspot\target\dspot.jar
2018-11-01 12:41:04,391 INFO eu.stamp_project.testrunner.EntryPoint - E:\Dev\stamp\dspot\dspot\target\dspot.jar
2018-11-01 12:41:04,391 INFO eu.stamp_project.testrunner.EntryPoint - E:\Dev\stamp\dspot\dspot\target\dspot.jar
2018-11-01 12:41:04,391 INFO eu.stamp_project.testrunner.EntryPoint - E:\Dev\stamp\dspot\dspot\target\dspot.jar
2018-11-01 12:41:04,391 WARN eu.stamp_project.automaticbuilder.AutomaticBuilderFactory - : unknown automatic builder specified in configuration, going to default.
2018-11-01 12:41:04,391 INFO eu.stamp_project.automaticbuilder.AutomaticBuilderFactory - Default: provided Maven automatic builder.
2018-11-01 12:41:04,407 INFO eu.stamp_project.automaticbuilder.MavenAutomaticBuilder - Using C:\Dev\maven for maven home
2018-11-01 12:41:04,407 INFO eu.stamp_project.automaticbuilder.MavenAutomaticBuilder - run maven: C:\Dev\maven/bin/mvn clean test -DskipTests dependency:build-classpath -Dmdep.outputFile=target/dspot/classpath
[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building test-projects 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ example ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ example ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ example ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ example ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ example ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 3 source files to E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ example ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-dependency-plugin:2.8:build-classpath (default-cli) @ example ---
[INFO] Wrote classpath file 'E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\dspot\classpath'.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.478 s
[INFO] Finished at: 2018-11-01T12:41:10+01:00
[INFO] Final Memory: 21M/199M
[INFO] ------------------------------------------------------------------------
2018-11-01 12:41:11,143 INFO eu.stamp_project.dspot.Amplification - Amplification of example.TestSuiteExample (6 test(s))
2018-11-01 12:41:11,143 INFO eu.stamp_project.dspot.Amplification - Assertion amplification of example.TestSuiteExample (6 test(s))
2018-11-01 12:41:11,204 INFO eu.stamp_project.utils.compilation.DSpotCompiler - Compiling with -proceedOnError -encoding UTF-8 -cp E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\dspot\tmp_test_sources;C:\Users\Larsgiang\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\Larsgiang\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/classes/\;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/test-classes/\;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/dspot/dependencies/; -d E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\test-classes -1.8 -preserveAllLocals -noExit -enableJavadoc -proc:none E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\dspot\tmp_test_sources\example\TestSuiteExample.java
2018-11-01 12:41:11,285 INFO eu.stamp_project.testrunner.EntryPoint - Run: java -Xmx2048m -Xms1024m -classpath E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target\test-classes;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/classes/\;C:\Users\Larsgiang\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\Larsgiang\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/dspot/dependencies/;E:\Dev\stamp\dspot\dspot\target\dspot.jar eu.stamp_project.testrunner.runner.test.TestRunner example.TestSuiteExample test2;test3;test4;test7;test8;test9
File saved to the following path: E:\Dev\stamp\dspot\dspot\target\dspot\TestListener.ser
Loading E:\Dev\stamp\dspot\dspot\target\dspot\TestListener.ser
2018-11-01 12:41:11,601 INFO eu.stamp_project.testrunner.EntryPoint - Test has been run: test2,test3,test4,test7,test8,test9
2018-11-01 12:41:11,601 INFO eu.stamp_project.testrunner.EntryPoint - Run: java -Xmx2048m -Xms1024m -classpath C:\Users\Larsgiang\.m2\repository\junit\junit\4.11\junit-4.11.jar;C:\Users\Larsgiang\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/classes/\;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/test-classes/\;E:\Dev\stamp\dspot\dspot\target\dspot.jar;E:\Dev\stamp\dspot\dspot\target\dspot.jar;E:\Dev\stamp\dspot\dspot\target\dspot.jar;E:\Dev\stamp\dspot\dspot\target\dspot.jar eu.stamp_project.testrunner.runner.coverage.JacocoRunner E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/classes/\;E:\Dev\stamp\dspot\dspot\src\test\resources\test-projects\target/test-classes/\ example.TestSuiteExample
Exception in thread "main" java.lang.RuntimeException: xample\Example.class,E:\Dev\stamp\dspot\dspot\xample\Example.class,xample.Example
        at eu.stamp_project.testrunner.runner.coverage.JacocoRunner.instrumentAll(JacocoRunner.java:209)
        at eu.stamp_project.testrunner.runner.coverage.JacocoRunner.<init>(JacocoRunner.java:108)
        at eu.stamp_project.testrunner.runner.coverage.JacocoRunner.<init>(JacocoRunner.java:90)
        at eu.stamp_project.testrunner.runner.coverage.JacocoRunner.main(JacocoRunner.java:57)
Caused by: java.io.IOException: Error while instrumenting class xample.Example.
        at org.jacoco.core.instr.Instrumenter.instrumentError(Instrumenter.java:166)
        at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:138)
        at eu.stamp_project.testrunner.runner.coverage.JacocoRunner.instrumentAll(JacocoRunner.java:207)
        ... 3 more
Caused by: java.lang.IllegalArgumentException
        at org.jacoco.core.internal.Java9Support.readFully(Java9Support.java:45)
        at org.jacoco.core.instr.Instrumenter.instrument(Instrumenter.java:136)
        ... 4 more
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: E:\Dev\stamp\dspot\dspot\target\dspot\globalCoverageResult.ser does not exist.
        at eu.stamp_project.Main.runExample(Main.java:95)
        at eu.stamp_project.Main.main(Main.java:38)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: E:\Dev\stamp\dspot\dspot\target\dspot\globalCoverageResult.ser does not exist.
        at eu.stamp_project.testrunner.runner.test.Loader.load(Loader.java:23)
        at eu.stamp_project.testrunner.runner.coverage.Coverage.load(Coverage.java:100)
        at eu.stamp_project.testrunner.EntryPoint.runCoverage(EntryPoint.java:313)
        at eu.stamp_project.testrunner.EntryPoint.runCoverageOnTestClasses(EntryPoint.java:212)
        at eu.stamp_project.dspot.selector.JacocoCoverageSelector.selectToAmplify(JacocoCoverageSelector.java:61)
        at eu.stamp_project.dspot.Amplification.amplification(Amplification.java:83)
        at eu.stamp_project.dspot.DSpot._amplify(DSpot.java:231)
        at eu.stamp_project.dspot.DSpot.lambda$amplifyTestClassesTestMethods$6(DSpot.java:210)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
        at eu.stamp_project.dspot.DSpot.amplifyTestClassesTestMethods(DSpot.java:211)
        at eu.stamp_project.Main.runExample(Main.java:93)
        ... 1 more
Caused by: java.io.FileNotFoundException: E:\Dev\stamp\dspot\dspot\target\dspot\globalCoverageResult.ser does not exist.
        ... 18 more
danglotb commented 5 years ago

Closing this issue. Please reopen it or open a new one. Thank you.