try to run all tests, the second test fails with spurious ClassLoader
errors (again).

Never heard about such a problem before. Did you submit an issue?

The root cause for the classloader problem should be similar as with http://issues.gradle.org/browse/GRADLE-1516. I've been plagued with such problems the last couple of days ;)


Can you
provide a self-contained example that demonstrates the problem?

I will submit a new issue with an example.


I guess the granularity of that property only applies to classes, not
methods?

Yes.

Thanks for the confirmation. Any plans to provide even more fine-grained control? Or is this something that could be solved with a JUnit runner? The same probably applies for parallel execution.


The final workaround was to move each method into its own class

Are you sure there isn't something wrong with your test?

Positive. All tests run just fine when moved into distinct classes. The classloader problem vanishes, once a new JVM is used for each test. As the "forkEvery" property only works on the class level, it makes perfect sense to me. I really need to perform each test method in isolation to workaround the classloading issue.


What platform?

I've only tested on Ubuntu Lucid 64 Bit, latest Oracle JDK, but it should not matter. I can perform testing on Mac OS X as well, if you demand it.


Can you show the code and the stack trace?

I will once I have a self-contained example. Each test method triggers a build using this code:

DefaultGradleConnector connector = (DefaultGradleConnector) GradleConnector.newConnector();
connector.embedded(true);

ProjectConnection conn = connector.forProjectDirectory(rDirectory).connect();

try {
  BuildLauncher launcher = conn.newBuild().forTasks("processResources");
  launcher.run();
} finally {
  conn.close();
}

The connector probably stays alive as long as the JVM is active and some state interferes between runs. Thanks.

Cheers,

Marco


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to