[JBoss Microcontainer Development] - Re: Testing Deployers with new Reflect + ClassPool
by kabir.khan@jboss.com
I've had a look
| public void testURLChildOfGlobalUcl() throws Exception
| {
| L globalLoader = testScenario.createLoader(new CLDeploymentBuilder("GLOBAL", JAR_A_1));
| L childALoader = createChildURLLoader(globalLoader, JAR_B_1);
|
| testScenario.loadClass(childALoader, globalLoader, CLASS_A);
| testScenario.loadClass(childALoader, CLASS_B);
|
| L childBLoader = createChildURLLoader(globalLoader, JAR_A_2);
| System.out.println("========> G" + globalLoader);
| System.out.println("========> A " + childALoader);
| System.out.println("========> B " + childBLoader);
| testScenario.loadClass(childBLoader, globalLoader, CLASS_A);
| }
|
The output shows G and A to always have a classloader, probably because the testScenario call maintains a strong reference to the loader? B sometimes is shown to have null loader, so createChildURLLoader needs to be reworked somehow to maintain a strong reference to the loader.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268480#4268480
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268480
16 years, 1 month
[JBoss Microcontainer Development] - Re: Testing Deployers with new Reflect + ClassPool
by kabir.khan@jboss.com
"alesj" wrote :
| I guess you no
| Well, this works too, but, as it's shows, it makes harder to test/debug tests.
| I thought you would use VFS's Assembled notion.
| Or is there a valid reason you didn't?
|
Not really, I wasn't familiar with that at the time
"flavia" wrote :
| Thanks for verifying that :-)
|
| Ales told me that the NPE is reproducible only under JDK5. Still, I have tested it with JDK5 and again couldn't see any failure.
|
Using JDK 5 I see this error:
| Tests run: 18, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.023 sec <<< FAILURE!
| testURLChildOfGlobalUcl(org.jboss.test.classpool.jbosscl.test.RepositoryClassPoolTestCase) Time elapsed: 0.065 sec <<< ERROR!
| java.lang.IllegalStateException: Illegal call. A class cannot be retrieved from ClassPool org.jboss.classpool.plugins.as.NonDelegatingClassPool@15141466 [class path: <null>:] - dcl:null because the corresponding ClassLoader is garbage collected
| at org.jboss.classpool.base.BaseClassPool.get(BaseClassPool.java:130)
| at org.jboss.test.classpool.support.ClassPoolTestScenario.assertLoadCtClassArray(ClassPoolTestScenario.java:173)
| at org.jboss.test.classpool.support.ClassPoolTestScenario.assertLoadCtClassArray(ClassPoolTestScenario.java:163)
| at org.jboss.test.classpool.support.ClassPoolTestScenario.assertLoadCtClass(ClassPoolTestScenario.java:155)
| at org.jboss.test.classpool.support.ClassPoolTestScenario.loadClass(ClassPoolTestScenario.java:79)
| at org.jboss.test.classpool.support.ClassPoolTestScenario.loadClass(ClassPoolTestScenario.java:44)
| at org.jboss.test.classpool.jbosscl.test.RepositoryTest.testURLChildOfGlobalUcl(RepositoryTest.java:155)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268460#4268460
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268460
16 years, 1 month