[ http://jira.codehaus.org/browse/MSUREFIRE-115?page=comments#action_65715 
] 

Mark Holster commented on MSUREFIRE-115:
----------------------------------------

I've tried to provide a patch for this issue, but after debugging for a while 
i'm not sure if this is a bug: The java.util.Date class is loaded by the system 
classloader while the resource is on the URLClasspath of the isolated 
classloader that surefire provides. Trying to find a resource in the isolated 
classloader from the system classloader will never work because of the 
classloading hierarchy.

As documented the surefire plugin runs the tests in the isolated classloader, 
and therefore (I think) this issue isn't  a bug but a consequence of the 
classloading hiererchy.  As far as I can see the only solution to this issue is 
not loading the tests in the isolated classloader but in the app- or system 
classloader. Can a surefire guru confirm this :)? Should I try to provide a 
patch that runs the tests outside the isolated classloader?

> Classloading problem for getting a resource
> -------------------------------------------
>
>          Key: MSUREFIRE-115
>          URL: http://jira.codehaus.org/browse/MSUREFIRE-115
>      Project: Maven 2.x Surefire Plugin
>         Type: Bug

>     Versions: 2.1.3, 2.2
>  Environment: Maven 2.0.4
> Windows XP
>     Reporter: Wim Deblauwe
>     Priority: Blocker
>  Attachments: surefire-test.zip
>
>
> We are using Betwixt and some of our unit tests fail when run using
> surefire, but run fine in IntelliJ or Maven 1. Betwixt looks for
> descriptors with the name of the class + .betwixt to control how
> something is written out in XML. It uses the construct:
> myClass.getResource() to find the .betwixt file.
> E.g. com.mycomp.MyClass -> com/mycomp/MyClass.betwixt
> We have a betwixt file for the java.util.Date class. However, betwixt
> seems to be unable to pick it up when using surefire. I have created a
> small test that shows the problem and have attached it.
> I tried with version 2.2 using different configurations (never, once, 
> pertest) and with version 2.1.3 (default configuration)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to