Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix execution of DSpot maven plugin on test example #395

Closed
nicolabertazzo opened this issue Apr 11, 2018 · 8 comments
Closed

Fix execution of DSpot maven plugin on test example #395

nicolabertazzo opened this issue Apr 11, 2018 · 8 comments
Assignees

Comments

@nicolabertazzo
Copy link
Contributor

nicolabertazzo commented Apr 11, 2018

Characteristics

  • Issue Type: [bug]
  • Reproducibility: [always]
  • Severity: [major]
  • Tool/Service/Component: [dspot-maven, 1.0.7-SNAPSHOT, dspot-maven, 1.0.7-SNAPSHOT]
  • Execution Environment: [Linux Ubuntu]
  • Reporter: [Nicola Bertazzo, [email protected]]

Description

The execution of mvn from dspot/src/test/resources/test-projects doesn't produce the same output of the execution from command line (java -jar target/dspot-LATEST-jar-with-dependencies.jar --example)

Steps to reproduce

cd dspot
mvn install
cd dspot/src/test/resources/test-projects
mvn eu.stamp-project:dspot-maven:1.0.7-SNAPSHOT:amplify-unit-tests  -Damplifiers=TestDataMutator

Help on issue template

Preview to follow the link or open file .github/ISSUE_DOC.md

@nicolabertazzo nicolabertazzo self-assigned this Apr 11, 2018
nicolabertazzo added a commit that referenced this issue Apr 11, 2018
fix InputConfiguration getRelativePath conversion
@nicolabertazzo
Copy link
Contributor Author

the execution of dspot from maven plugin returns this error:

[ERROR] Failed to execute goal eu.stamp-project:dspot-maven:1.0.8-SNAPSHOT:amplify-unit-tests (default-cli) on project example: Execution default-cli of goal eu.stamp-project:dspot-maven:1.0.8-SNAPSHOT:amplify-unit-tests failed: An API incompatibility was encountered while executing eu.stamp-project:dspot-maven:1.0.8-SNAPSHOT:amplify-unit-tests: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>eu.stamp-project:dspot-maven:1.0.8-SNAPSHOT
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/bertazzo/.m2/repository/eu/stamp-project/dspot-maven/1.0.8-SNAPSHOT/dspot-maven-1.0.8-SNAPSHOT.jar
[ERROR] urls[1] = file:/home/bertazzo/.m2/repository/eu/stamp-project/dspot/1.0.8-SNAPSHOT/dspot-1.0.8-SNAPSHOT.jar
[ERROR] urls[2] = file:/home/bertazzo/.m2/repository/fr/inria/gforge/spoon/spoon-core/6.1.0/spoon-core-6.1.0.jar
[ERROR] urls[3] = file:/home/bertazzo/.m2/repository/org/eclipse/tycho/org.eclipse.jdt.core/3.13.50.v20171007-0855/org.eclipse.jdt.core-3.13.50.v20171007-0855.jar
[ERROR] urls[4] = file:/home/bertazzo/.m2/repository/com/martiansoftware/jsap/2.1/jsap-2.1.jar
[ERROR] urls[5] = file:/home/bertazzo/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar
[ERROR] urls[6] = file:/home/bertazzo/.m2/repository/commons-io/commons-io/2.5/commons-io-2.5.jar
[ERROR] urls[7] = file:/home/bertazzo/.m2/repository/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar
[ERROR] urls[8] = file:/home/bertazzo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.2/jackson-databind-2.9.2.jar
[ERROR] urls[9] = file:/home/bertazzo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar
[ERROR] urls[10] = file:/home/bertazzo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.2/jackson-core-2.9.2.jar
[ERROR] urls[11] = file:/home/bertazzo/.m2/repository/junit/junit/4.12/junit-4.12.jar
[ERROR] urls[12] = file:/home/bertazzo/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[ERROR] urls[13] = file:/home/bertazzo/.m2/repository/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar
[ERROR] urls[14] = file:/home/bertazzo/.m2/repository/org/apache/maven/shared/maven-invoker/3.0.0/maven-invoker-3.0.0.jar
[ERROR] urls[15] = file:/home/bertazzo/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
[ERROR] urls[16] = file:/home/bertazzo/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.7/plexus-component-annotations-1.7.jar
[ERROR] urls[17] = file:/home/bertazzo/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar
[ERROR] urls[18] = file:/home/bertazzo/.m2/repository/org/jacoco/org.jacoco.core/0.7.9/org.jacoco.core-0.7.9.jar
[ERROR] urls[19] = file:/home/bertazzo/.m2/repository/org/ow2/asm/asm-debug-all/5.2/asm-debug-all-5.2.jar
[ERROR] urls[20] = file:/home/bertazzo/.m2/repository/eu/stamp-project/descartes/1.1/descartes-1.1.jar
[ERROR] urls[21] = file:/home/bertazzo/.m2/repository/org/pitest/pitest/1.2.0/pitest-1.2.0.jar
[ERROR] urls[22] = file:/home/bertazzo/.m2/repository/org/pitest/pitest-entry/1.2.0/pitest-entry-1.2.0.jar
[ERROR] urls[23] = file:/home/bertazzo/.m2/repository/com/thoughtworks/xstream/xstream/1.4.8/xstream-1.4.8.jar
[ERROR] urls[24] = file:/home/bertazzo/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar
[ERROR] urls[25] = file:/home/bertazzo/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar
[ERROR] urls[26] = file:/home/bertazzo/.m2/repository/org/gradle/gradle-tooling-api/4.0.1/gradle-tooling-api-4.0.1.jar
[ERROR] urls[27] = file:/home/bertazzo/.m2/repository/org/mockito/mockito-core/2.10.0/mockito-core-2.10.0.jar
[ERROR] urls[28] = file:/home/bertazzo/.m2/repository/net/bytebuddy/byte-buddy/1.7.4/byte-buddy-1.7.4.jar
[ERROR] urls[29] = file:/home/bertazzo/.m2/repository/net/bytebuddy/byte-buddy-agent/1.7.4/byte-buddy-agent-1.7.4.jar
[ERROR] urls[30] = file:/home/bertazzo/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar
[ERROR] urls[31] = file:/home/bertazzo/.m2/repository/eu/stamp-project/test-runner/1.0.3/test-runner-1.0.3-jar-with-dependencies.jar
[ERROR] urls[32] = file:/home/bertazzo/.m2/repository/org/openclover/clover/4.2.1/clover-4.2.1.jar
[ERROR] urls[33] = file:/home/bertazzo/.m2/repository/fr/inria/gforge/spoon/labs/gumtree-spoon-ast-diff/1.3/gumtree-spoon-ast-diff-1.3.jar
[ERROR] urls[34] = file:/home/bertazzo/.m2/repository/com/github/gumtreediff/core/2.0.0/core-2.0.0.jar
[ERROR] urls[35] = file:/home/bertazzo/.m2/repository/com/github/mpkorstanje/simmetrics-core/3.0.3/simmetrics-core-3.0.3.jar
[ERROR] urls[36] = file:/home/bertazzo/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar
[ERROR] urls[37] = file:/home/bertazzo/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
[ERROR] urls[38] = file:/home/bertazzo/.m2/repository/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar
[ERROR] urls[39] = file:/home/bertazzo/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[40] = file:/home/bertazzo/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[41] = file:/home/bertazzo/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.3.3/org.eclipse.sisu.inject-0.3.3.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

If I execute the plugin from junit test it works.

@danglotb
Copy link
Member

Hi @nicolabertazzo

I would like to help you, but could please give more information? Like the command line you used.

Also, I suggest you to update (git pull origin master) since I saw that you are still in 1.0.8 while I release 1.1.0 last week.

Thank you!

@nicolabertazzo
Copy link
Contributor Author

nicolabertazzo commented Apr 20, 2018

I merged the changes of the branch with the master.
to reproduce the error:

  • checkout the branch issue-395
  • build the project (mvn install)
  • go to test project folder (cd dspot/dspot/src/test/resources/test-projects)
  • fix the path in pom.xml
  • execute the command mvn clean eu.stamp-project:dspot-maven:1.1.1-SNAPSHOT:amplify-unit-tests

If you execute the test dspot/dspot-maven/src/test/java/eu/stamp_project/DSpotMojoTest.java from JUnit, it works.

@danglotb
Copy link
Member

Hi @nicolabertazzo

Okay thank you, I'm gonna have a look ASAP.

I think it might come from a wrong classpath or something like this.

@danglotb
Copy link
Member

Hi,

The problem come from the test runner.

It seems that the way that I found the classes to run the test does not work with the maven plugin.

I am working on it.

@danglotb
Copy link
Member

Hi @nicolabertazzo

I just fixed the problem, opened a PR on testrunner project see STAMP-project/test-runner#18

I'm gonna release the new testrunner, and update dependencies of DSpot right after the merge.

I'll ping you when it is done.

Thank you.

@danglotb
Copy link
Member

Hi @nicolabertazzo

DSpot depends now on the new test-runner.

You will have to rebase with the master branch:

git checkout master
git pull origin master
git checkout issue-395
git rebase master
# solve the eventual conflicts

And then, reinstall everything by running mvn clean install -DskipTests at the root of DSpot.

I was able to amplify the test-projects using the maven plugin.

Cheers!

@nicolabertazzo
Copy link
Contributor Author

nicolabertazzo commented Apr 23, 2018

it works!!
Thanks a lot.
As soon as I'll finish to add the all the dspot parameters to the maven plugin i'll push it to the master branch.

nicolabertazzo added a commit that referenced this issue Apr 23, 2018
fix InputConfiguration getRelativePath conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants