Infamous Junit classloader bug

2004-04-15 Thread Brice Copy
Hello,

Has anyone managed to patch the infamous JUnit classloader bug when 
running their unit tests with maven ?
(the bug is documented here : http://junit.sourceforge.net/doc/faq/faq.htm
and fixes are http://www.artima.com/forums/flat.jsp?forum=121thread=7886
and here http://users.rcn.com/scottstirling/2003/07/19.html  but it's 
not been released as a JUnit build yet)

Because my unit test cases use the DOM classes, I get the following 
error when running maven test:test :
--
BUILD FAILED
File.. file:/C:/Documents and 
Settings/bcopy/.maven/plugins/maven-test-plugin-1.4/
Element... junit
Line.. 94
Column 39
Class org/w3c/dom/Element violates loader constraints
Total time: 29 seconds
Finished at: Thu Apr 15 16:30:32 CEST 2004

--

I tried to change a few properties here and there, but it's either the 
taskdefs cannot be found, or this classloader problem.

Funny thing, the bug doesn't occur when I launch maven jcoverage - my 
tests complete succesfully.

Has anyone managed to integrate a patch for this bug in the maven 
classpath ?
(I could patch the official junit 3.8.1 JAR file distributed with Maven, 
but I'd rather not - I know the patch for this bug is in JUnit CVS - but 
yet unreleased)

Thanks for any hints on the subject,

Brice



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Infamous Junit classloader bug

2004-04-15 Thread Brice Copy
The problem mentionned above is solved.

I came across
http://maven.apache.org/faq.html#unit-test-14
and added
maven.junit.fork=yes
to my project properties.

Perhaps the FAQ could be more precise, and include a sample error 
message like :

Class org/w3c/dom/Element violates loader constraints

Cheers

Brice

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Infamous Junit classloader bug

2004-04-15 Thread Sean Radford
Yes, it is the nasty delegating classloader of Ant that is causing the
problem...

http://femur/roller/page/sradford/Weblog/20040325#classcastexception_and_junit

Sean


On Thu, 2004-04-15 at 15:52, Brice Copy wrote:
 The problem mentionned above is solved.
 
 I came across
  http://maven.apache.org/faq.html#unit-test-14
 and added
 maven.junit.fork=yes
 
 to my project properties.
 
 Perhaps the FAQ could be more precise, and include a sample error 
 message like :
 
 Class org/w3c/dom/Element violates loader constraints
 
 Cheers
 
 Brice
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Dr. Sean Radford, MBBS, MSc
[EMAIL PROTECTED]
http://bladesys.demon.co.uk/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]