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?

Best Regards,
Tom

Reply via email to