[jboss-cvs] JBossAS SVN: r82307 - projects/aop/trunk/asintegration-core/src/tests/org/jboss/test/aop/classpool/test.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 16 06:16:04 EST 2008
Author: kabir.khan at jboss.com
Date: 2008-12-16 06:16:04 -0500 (Tue, 16 Dec 2008)
New Revision: 82307
Modified:
projects/aop/trunk/asintegration-core/src/tests/org/jboss/test/aop/classpool/test/ClassPoolTest.java
Log:
[JBAOP-666] Add test checking that the test classes are not on the classpath
Modified: projects/aop/trunk/asintegration-core/src/tests/org/jboss/test/aop/classpool/test/ClassPoolTest.java
===================================================================
--- projects/aop/trunk/asintegration-core/src/tests/org/jboss/test/aop/classpool/test/ClassPoolTest.java 2008-12-16 10:33:46 UTC (rev 82306)
+++ projects/aop/trunk/asintegration-core/src/tests/org/jboss/test/aop/classpool/test/ClassPoolTest.java 2008-12-16 11:16:04 UTC (rev 82307)
@@ -114,4 +114,24 @@
super.setUp();
enableTrace("org.jboss.aop.classpool.DelegatingClassPool");
}
-}
+
+ protected void assertCannotLoadClass(ClassLoader loader, String classname)
+ {
+ try
+ {
+ loader.loadClass(classname);
+ fail("Should not have been able to load " + classname);
+ }
+ catch(ClassNotFoundException expected)
+ {
+ }
+ }
+
+ /**
+ * The test classes should not be on the launcher classpath
+ */
+ public void testClassesNotOnClasspath()
+ {
+ assertCannotLoadClass(this.getClass().getClassLoader(), CLASS_A);
+ assertCannotLoadClass(this.getClass().getClassLoader(), CLASS_B);
+ }}
More information about the jboss-cvs-commits
mailing list