----- Original Message -----
From: "Stefan Bodewig" <[EMAIL PROTECTED]>


> On 19 Feb 2002, <[EMAIL PROTECTED]> wrote:
>
> >   JUnitClassLoaderTest.java
>
> fails in GUMP.

> I think this is because getClass().getClassloader() is the system
> classloader, not the AntClassLoader.

sh*, that's right.

> Hmm, let me see, yes.  If I add build/testcases to my system
> classpath, the test fails.
>
> I'm going to disable it in that case, but we need to fix the test
> itself.  Any idea how we could make a reasonable testcase for the case
> where the testclass itself can be loaded via the system classloader?

Something like this
(sorry, from memory so some methods might not exists, I'm close to leave,
will be back in a couple of hours)

ClassLoader cl = null;
if (ClassLoader.getSystemResourceAsStream(testclass) != null){
    cl = ClassLoader.getSystemClassLoader();
} else {
    cl = getClass().getClassLoader();
}
assertSame(context, cl);



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

Reply via email to