classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ServiceFactory


From: Chris Gray
Subject: Re: ServiceFactory
Date: Fri, 19 Mar 2004 13:59:28 +0100

On Friday 19 March 2004 12:05, Sascha Brawer wrote:

> 4. The Mauve tests #5 and #8 fail both on JamVM and on gcj. (Thanks to
> Michael Koch for testing on gcj, by the way). Basically, what happens is
> something like the following:
>
>   Class c = myClassLoader.loadClass("name");
>   harness.check(c.getClassLoader() == myClassLoader);
>
> Can anyone explain why this fails? myClassLoader is an instance of
> gnu.testlet.gnu.classpath.ServiceFact
> ory.lookupProviders.CustomClassLoader, which doesn't override loadClass.

c.getClassLoader() returns the class loader which defined the class. Since 
your CustomClassLoader quite properly uses the default loadClass() 
implementation, Class c may be loaded by an ancestor. So your test needs to 
match myClassLoader, but also the transitive closure of getParent().

Have fun,

-- 
Chris Gray                                  /k/ Embedded Java Solutions
Embedded & Mobile Java, OSGi              http://www.kiffer.be/k/
address@hidden                                      +32 3 216 0369




reply via email to

[Prev in Thread] Current Thread [Next in Thread]