commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomasz Błachowicz" <tblachow...@gmail.com>
Subject [commons-lang] Running tests using Maven2
Date Thu, 30 Nov 2006 17:21:19 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message