commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henri Yandell" <>
Subject Re: [commons-lang] Running tests using Maven2
Date Thu, 30 Nov 2006 19:40:00 GMT
On 11/30/06, Tomasz Błachowicz <> wrote:
> Hi,
> I've been experiencing a problem when I try to run commons-lang tests using
> Maven2. When I run tests within my Eclipse IDE, it works fine. EnumTest.
> testColorEnumEqualsWithDifferentClassLoaders fails bacause of the issue with
> class loader. The code of this test calls method
> ClassUtilsTest.newSystemClassLoader() and there you can find following
> snippet of code:
> ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
> ClassLoader myClassLoader = ClassUtilsTest.class.getClassLoader();
> /.../
> if (!myClassLoader.equals(systemClassLoader)) {
>   fail("Need a better test set up?");
> }
> The problem while running using Maven's surefire plugin is that
> systemClassLoader is of class sun.misc.Launcher$AppClassLoader and
> myClassLoader is of class
> org.apache.maven.surefire.booter.IsolatedClassLoader and they are not equal.
> Do anyone of you have any ideas how to fix that and be able fo run tests
> using Maven2?

Nope :( I got the same problems myself when I made the pom.xml. I
figured it was still worth committing even if it doesn't work yet.

Haven't dug heavily into it yet; I've had a little bit of a Lang
vacation to cause trouble in other components :)

View raw message