[jboss-cvs] JBossAS SVN: r82117 - projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 8 13:02:26 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-12-08 13:02:26 -0500 (Mon, 08 Dec 2008)
New Revision: 82117
Modified:
projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java
Log:
[JBAOP-666] Add bigger sanity test
Modified: projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java
===================================================================
--- projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java 2008-12-08 17:47:45 UTC (rev 82116)
+++ projects/aop/trunk/asintegration-mc/src/tests/org/jboss/test/aop/classpool/jbosscl/test/ClassLoaderWithRepositorySanityTestCase.java 2008-12-08 18:02:26 UTC (rev 82117)
@@ -388,132 +388,136 @@
}
}
-// public void testSeveralLevelsOfDomain() throws Exception
-// {
-// ClassLoader parent = null;
-// ClassLoader cl1B = null;
-// ClassLoader cl1C = null;
-// ClassLoader cl2B = null;
-// ClassLoader cl2C = null;
-// ClassLoader cl11A = null;
-// ClassLoader cl11B = null;
-// ClassLoader cl11C = null;
-// ClassLoader cl12A = null;
-// ClassLoader cl12B = null;
-// ClassLoader cl12C = null;
-//// ClassLoader cl21A = null;
-//// ClassLoader cl21B = null;
-//// ClassLoader cl21C = null;
-//// ClassLoader cl22A = null;
-//// ClassLoader cl22B = null;
-//// ClassLoader cl22C = null;
-//
-// try
-// {
-// parent = createClassLoader("A", true, JAR_A_1);
-// Class<?> aFromParent = parent.loadClass(CLASS_A);
-// assertSame(parent, aFromParent.getClassLoader());
-//
-// final String domain1 = "1";
-// cl1B = createChildDomainParentFirstClassLoader("1B", domain1, true, JAR_B_1);
-// cl1C = createChildDomainParentFirstClassLoader("1C", domain1, true, JAR_C_1);
-// Class<?> aFrom1B = cl1B.loadClass(CLASS_A);
-// Class<?> bFrom1B = cl1B.loadClass(CLASS_B);
-// Class<?> cFrom1B = cl1B.loadClass(CLASS_C);
-// Class<?> aFrom1C = cl1C.loadClass(CLASS_A);
-// Class<?> bFrom1C = cl1C.loadClass(CLASS_B);
-// Class<?> cFrom1C = cl1C.loadClass(CLASS_C);
-// assertSame(aFromParent, aFrom1B);
-// assertSame(aFromParent, aFrom1C);
-// assertSame(bFrom1B, bFrom1C);
-// assertSame(cFrom1B, cFrom1C);
-// assertSame(cl1B, bFrom1B.getClassLoader());
-// assertSame(cl1C, cFrom1B.getClassLoader());
-//
-//
-// final String domain2 = "2";
-// cl2B = createChildDomainParentFirstClassLoader("2B", domain2, true, JAR_B_1);
-// cl2C = createChildDomainParentFirstClassLoader("2C", domain2, true, JAR_C_1);
-// Class<?> aFrom2B = cl2B.loadClass(CLASS_A);
-// Class<?> bFrom2B = cl2B.loadClass(CLASS_B);
-// Class<?> cFrom2B = cl2B.loadClass(CLASS_C);
-// Class<?> aFrom2C = cl2C.loadClass(CLASS_A);
-// Class<?> bFrom2C = cl2C.loadClass(CLASS_B);
-// Class<?> cFrom2C = cl2C.loadClass(CLASS_C);
-// assertSame(aFromParent, aFrom2B);
-// assertSame(aFromParent, aFrom2C);
-// assertSame(bFrom2B, bFrom2C);
-// assertSame(cFrom2B, cFrom2C);
-// assertSame(cl2B, bFrom2B.getClassLoader());
-// assertSame(cl2C, cFrom2B.getClassLoader());
-// assertNotSame(bFrom1B, bFrom2B);
-// assertNotSame(bFrom2C, bFrom1C);
-// assertNotSame(cFrom2C, cFrom1C);
-//
-// final String domain11 = "11";
-// cl11A = createChildDomainParentFirstClassLoader("11A", domain11, domain1, true, JAR_A_2);
-// cl11B = createChildDomainParentFirstClassLoader("11B", domain11, domain1, true, JAR_B_2);
-// cl11C = createChildDomainParentFirstClassLoader("11C", domain11, domain1, true, JAR_C_2);
-// final String domain12 = "12";
-// cl12A = createChildDomainParentLastClassLoader("11A", domain12, domain1, true, JAR_A_2);
-// cl12B = createChildDomainParentLastClassLoader("11B", domain12, domain1, true, JAR_B_2);
-// cl12C = createChildDomainParentLastClassLoader("11C", domain12, domain1, true, JAR_C_2);
-// Class<?> aFrom11A = cl11A.loadClass(CLASS_A);
-// Class<?> aFrom11B = cl11B.loadClass(CLASS_A);
-// Class<?> aFrom11C = cl11C.loadClass(CLASS_A);
-// assertSame(aFromParent, aFrom11A);
-// assertSame(aFromParent, aFrom11B);
-// assertSame(aFromParent, aFrom11C);
-// Class<?> aFrom12A = cl12A.loadClass(CLASS_A);
-// Class<?> aFrom12B = cl12B.loadClass(CLASS_A);
-// Class<?> aFrom12C = cl12C.loadClass(CLASS_A);
-// assertNotSame(aFromParent, aFrom12A);
-// assertSame(aFrom12A, aFrom12B);
-// assertSame(aFrom12A, aFrom12C);
-// assertSame(cl12A, aFrom12A.getClassLoader());
-//
-// Class<?> bFrom11A = cl11A.loadClass(CLASS_B);
-// Class<?> bFrom11B = cl11B.loadClass(CLASS_B);
-// Class<?> bFrom11C = cl11C.loadClass(CLASS_B);
-// Class<?> cFrom11A = cl11A.loadClass(CLASS_C);
-// Class<?> cFrom11B = cl11B.loadClass(CLASS_C);
-// Class<?> cFrom11C = cl11C.loadClass(CLASS_C);
-// assertSame(bFrom11A, bFrom11B);
-// assertSame(bFrom11A, bFrom11C);
-// assertSame(cl12B, bFrom11B.getClassLoader());
-// assertSame(cFrom11A, cFrom11B);
-// assertSame(cFrom11A, cFrom11C);
-// assertSame(cl12C, bFrom11C.getClassLoader());
-//
-// Class<?> bFrom12A = cl12A.loadClass(CLASS_B);
-// Class<?> bFrom12B = cl12B.loadClass(CLASS_B);
-// Class<?> bFrom12C = cl12C.loadClass(CLASS_B);
-// Class<?> cFrom12A = cl12A.loadClass(CLASS_C);
-// Class<?> cFrom12B = cl12B.loadClass(CLASS_C);
-// Class<?> cFrom12C = cl12C.loadClass(CLASS_C);
-//
-//
-//
-//// final String domain21 = "21";
-// }
-// finally
-// {
-// unregisterClassLoader(parent);
-// unregisterClassLoader(cl1B);
-// unregisterClassLoader(cl1C);
-// unregisterClassLoader(cl2B);
-// unregisterClassLoader(cl2C);
-// unregisterClassLoader(cl11A);
-// unregisterClassLoader(cl11B);
-// unregisterClassLoader(cl11C);
-// unregisterClassLoader(cl12A);
-// unregisterClassLoader(cl12B);
-// unregisterClassLoader(cl12C);
-//
-// unregisterDomain(cl12A);
-// unregisterDomain(cl11A);
-// unregisterDomain(cl2B);
-// unregisterDomain(cl1B);
-// }
-// }
+ public void testSeveralLevelsOfDomain() throws Exception
+ {
+ ClassLoader parent = null;
+ ClassLoader cl1B = null;
+ ClassLoader cl1C = null;
+ ClassLoader cl2B = null;
+ ClassLoader cl2C = null;
+ ClassLoader cl11A = null;
+ ClassLoader cl11B = null;
+ ClassLoader cl11C = null;
+ ClassLoader cl12A = null;
+ ClassLoader cl12B = null;
+ ClassLoader cl12C = null;
+// ClassLoader cl21A = null;
+// ClassLoader cl21B = null;
+// ClassLoader cl21C = null;
+// ClassLoader cl22A = null;
+// ClassLoader cl22B = null;
+// ClassLoader cl22C = null;
+
+ try
+ {
+ parent = createClassLoader("A", true, JAR_A_1);
+ Class<?> aFromParent = parent.loadClass(CLASS_A);
+ assertSame(parent, aFromParent.getClassLoader());
+
+ final String domain1 = "1";
+ cl1B = createChildDomainParentFirstClassLoader("1B", domain1, true, JAR_B_1);
+ cl1C = createChildDomainParentFirstClassLoader("1C", domain1, true, JAR_C_1);
+ Class<?> aFrom1B = cl1B.loadClass(CLASS_A);
+ Class<?> bFrom1B = cl1B.loadClass(CLASS_B);
+ Class<?> cFrom1B = cl1B.loadClass(CLASS_C);
+ Class<?> aFrom1C = cl1C.loadClass(CLASS_A);
+ Class<?> bFrom1C = cl1C.loadClass(CLASS_B);
+ Class<?> cFrom1C = cl1C.loadClass(CLASS_C);
+ assertSame(aFromParent, aFrom1B);
+ assertSame(aFromParent, aFrom1C);
+ assertSame(bFrom1B, bFrom1C);
+ assertSame(cFrom1B, cFrom1C);
+ assertSame(cl1B, bFrom1B.getClassLoader());
+ assertSame(cl1C, cFrom1B.getClassLoader());
+
+
+ final String domain2 = "2";
+ cl2B = createChildDomainParentFirstClassLoader("2B", domain2, true, JAR_B_1);
+ cl2C = createChildDomainParentFirstClassLoader("2C", domain2, true, JAR_C_1);
+ Class<?> aFrom2B = cl2B.loadClass(CLASS_A);
+ Class<?> bFrom2B = cl2B.loadClass(CLASS_B);
+ Class<?> cFrom2B = cl2B.loadClass(CLASS_C);
+ Class<?> aFrom2C = cl2C.loadClass(CLASS_A);
+ Class<?> bFrom2C = cl2C.loadClass(CLASS_B);
+ Class<?> cFrom2C = cl2C.loadClass(CLASS_C);
+ assertSame(aFromParent, aFrom2B);
+ assertSame(aFromParent, aFrom2C);
+ assertSame(bFrom2B, bFrom2C);
+ assertSame(cFrom2B, cFrom2C);
+ assertSame(cl2B, bFrom2B.getClassLoader());
+ assertSame(cl2C, cFrom2B.getClassLoader());
+ assertNotSame(bFrom1B, bFrom2B);
+ assertNotSame(bFrom2C, bFrom1C);
+ assertNotSame(cFrom2C, cFrom1C);
+
+ final String domain11 = "11";
+ cl11A = createChildDomainParentFirstClassLoader("11A", domain11, domain1, true, JAR_A_2);
+ cl11B = createChildDomainParentFirstClassLoader("11B", domain11, domain1, true, JAR_B_2);
+ cl11C = createChildDomainParentFirstClassLoader("11C", domain11, domain1, true, JAR_C_2);
+ final String domain12 = "12";
+ cl12A = createChildDomainParentLastClassLoader("11A", domain12, domain1, true, JAR_A_2);
+ cl12B = createChildDomainParentLastClassLoader("11B", domain12, domain1, true, JAR_B_2);
+ cl12C = createChildDomainParentLastClassLoader("11C", domain12, domain1, true, JAR_C_2);
+ Class<?> aFrom11A = cl11A.loadClass(CLASS_A);
+ Class<?> aFrom11B = cl11B.loadClass(CLASS_A);
+ Class<?> aFrom11C = cl11C.loadClass(CLASS_A);
+ assertSame(aFromParent, aFrom11A);
+ assertSame(aFromParent, aFrom11B);
+ assertSame(aFromParent, aFrom11C);
+ Class<?> aFrom12A = cl12A.loadClass(CLASS_A);
+ Class<?> aFrom12B = cl12B.loadClass(CLASS_A);
+ Class<?> aFrom12C = cl12C.loadClass(CLASS_A);
+ assertNotSame(aFromParent, aFrom12A);
+ assertSame(aFrom12A, aFrom12B);
+ assertSame(aFrom12A, aFrom12C);
+ assertSame(cl12A, aFrom12A.getClassLoader());
+
+ Class<?> bFrom11A = cl11A.loadClass(CLASS_B);
+ Class<?> bFrom11B = cl11B.loadClass(CLASS_B);
+ Class<?> bFrom11C = cl11C.loadClass(CLASS_B);
+ Class<?> cFrom11A = cl11A.loadClass(CLASS_C);
+ Class<?> cFrom11B = cl11B.loadClass(CLASS_C);
+ Class<?> cFrom11C = cl11C.loadClass(CLASS_C);
+ assertSame(bFrom11A, bFrom11B);
+ assertSame(bFrom11A, bFrom11C);
+ assertSame(cl1B, bFrom11B.getClassLoader());
+ assertSame(cFrom11A, cFrom11B);
+ assertSame(cFrom11A, cFrom11C);
+ assertSame(cl1C, cFrom11C.getClassLoader());
+
+ Class<?> bFrom12A = cl12A.loadClass(CLASS_B);
+ Class<?> bFrom12B = cl12B.loadClass(CLASS_B);
+ Class<?> bFrom12C = cl12C.loadClass(CLASS_B);
+ Class<?> cFrom12A = cl12A.loadClass(CLASS_C);
+ Class<?> cFrom12B = cl12B.loadClass(CLASS_C);
+ Class<?> cFrom12C = cl12C.loadClass(CLASS_C);
+ assertSame(bFrom12A, bFrom12B);
+ assertSame(bFrom12A, bFrom12C);
+ assertSame(cl12B, bFrom12B.getClassLoader());
+ assertSame(cFrom12A, cFrom12B);
+ assertSame(cFrom12A, cFrom12C);
+ assertSame(cl12C, cFrom12C.getClassLoader());
+ assertNotSame(bFrom11B, bFrom12B);
+ assertNotSame(cFrom11C, cFrom12C);
+ }
+ finally
+ {
+ unregisterClassLoader(parent);
+ unregisterClassLoader(cl1B);
+ unregisterClassLoader(cl1C);
+ unregisterClassLoader(cl2B);
+ unregisterClassLoader(cl2C);
+ unregisterClassLoader(cl11A);
+ unregisterClassLoader(cl11B);
+ unregisterClassLoader(cl11C);
+ unregisterClassLoader(cl12A);
+ unregisterClassLoader(cl12B);
+ unregisterClassLoader(cl12C);
+
+ unregisterDomain(cl12A);
+ unregisterDomain(cl11A);
+ unregisterDomain(cl2B);
+ unregisterDomain(cl1B);
+ }
+ }
}
More information about the jboss-cvs-commits
mailing list