[GRADLE-1093] Allow running java plugin test task with a (weaving) system classloader Created: 05/Aug/10 Updated: 04/Jan/13 Resolved: 02/Apr/12 |
|
Status: | Resolved |
Project: | Gradle |
Affects Version/s: | 0.8 |
Fix Version/s: | 1.0-rc-1 |
Type: | Improvement | ||
Reporter: | Magnus Rundberget | Assignee: | Daz DeBoer |
Resolution: | Fixed | Votes: | 27 |
Description |
It would be really nice it the test task supported running with a custom system classloader. A typical use case would be the need to run tests with a WeavingURLClassLoader (aspectJ). example: test { systemProperties 'java.system.class.loader':'com.mycompany.system.test.MyWeavingURLClassLoader' }results in Comment from Adam; Below a more detailed example of a custom test task to illustrate what would be nice to achieve with the gradle supplied test task; build.gradle: classpath = configurations.antJunitTest //classpath with required ant artifacts build-tests-ltw.xml (ant build file) <junit printsummary="true" haltonfailure="no" fork="yes" forkmode="perBatch"> <formatter type="xml"/> <batchtest todir="${target.test.reports}" failureproperty="junit.failure"> <antcall target="writeJunitIfSet"/> <target name="writeJunitIfSet" if="junit.failure"> <target name="writeJunitIfNotSet" unless="junit.failure"> </project> |
Comments |
Comment by Steinar Haugen [ 15/Aug/11 ] |
Why has fix version for this issue changed from "1.0" to "someday"? The issue is (currently) 3rd in the list of unresolved issues, when sorting on "number of votes", so I expected it to get a high priority. Are the votes completely disregarded? We have an insufficient work-around for this, implementing our own test task using ant. The reason we consider this as an insufficient work-around, is that this differs from the rest of the build; e.g producing different reports, plugins that rely on the test task (like the cobertura plugin) don't work. |
Comment by Steinar Haugen [ 10/Nov/11 ] |
And now fix version is back to "1.0" again. Thanks. |
Comment by Daz DeBoer [ 24/Mar/12 ] |
We now launch the test process with all application jars on the classpath, rather than adding them dynamically at a later point. I've added an integration test that sets a custom ClassLoader for java.system.class.loader when running the tests, and this is now working ok. Please check with the latest nightly release if this issue is fixed for you. |