Closed mawHBT closed 2 years ago
Thanks for the PR. Just for my understanding: If the Java plugin is present, the test task is always present, and therefore needs to be configured? (So this would need to be done in https://github.com/DaGeRe/peass/blob/9c016e8959eab68ef8ae6ab08f2b9b7092db9862/dependency/src/main/java/de/dagere/peass/execution/gradle/GradleBuildfileEditor.java#L234, right?)
I'm at this line, tried to call enhanceTestTask(...) again after adding the testBlock. But I got;
Caught an unexpected exception while stack walking.
This is unexpected and is likely due to a change in either Java's StackWalker or Reflection APIs.
It's worth trying to upgrade to a newer version of Mockito, or otherwise to file a bug report.
But mockito is latest version.
Can't we assume testTask is always present, independent of java plugin? If there would be no tests, peass would have nothing to execute at all?
For the technical problem with mocking, it won't be possible to discuss this via GitHub.
Regarding testTask
: Some modules do not contain the Java plugin and therefore no test task, if we add test task configurations to them, errors occur. Therefore, we implemented the GradleTaskAnalyzer
before, and it is essential that we use the information from the task analyzer in order to determine which modules contain the Java plugin (and therefore the test task or an integrationTest task) and which don't.
Thanks for the corrections :) Seems fine to me now.
For issue #202 I added gradle-files and appropriate tests to check, if aspectJ-library is added to jvmArgs if no test-block is present. testAspectJAddedWithOnlyOneCallRecordingAndNoTestBlock currently fails and is therefore ignored.