[jboss-cvs] JBossAS SVN: r95612 - in projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool: support/web and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 27 11:19:01 EDT 2009
Author: alesj
Date: 2009-10-27 11:19:01 -0400 (Tue, 27 Oct 2009)
New Revision: 95612
Modified:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/PoolFactoryInitializer.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/web/AnyServlet.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.java
Log:
Add Classpool hierarchy test -- currently failing.
TODO for Flavia to fix it.
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/PoolFactoryInitializer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/PoolFactoryInitializer.java 2009-10-27 15:11:07 UTC (rev 95611)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/PoolFactoryInitializer.java 2009-10-27 15:19:01 UTC (rev 95612)
@@ -25,6 +25,7 @@
import org.jboss.classpool.spi.ClassPoolRepository;
import org.jboss.reflect.plugins.javassist.classpool.ClassPoolFactory;
import org.jboss.reflect.plugins.javassist.classpool.RepositoryClassPoolFactory;
+import org.jboss.reflect.plugins.javassist.classpool.DefaultClassPoolFactory;
import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactoryImpl;
/**
@@ -46,4 +47,9 @@
ClassPoolFactory classPoolFactory = new RepositoryClassPoolFactory(repository);
JavassistTypeInfoFactoryImpl.setPoolFactory(classPoolFactory);
}
+
+ public void stop()
+ {
+ JavassistTypeInfoFactoryImpl.setPoolFactory(DefaultClassPoolFactory.getInstance());
+ }
}
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/web/AnyServlet.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/web/AnyServlet.java 2009-10-27 15:11:07 UTC (rev 95611)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/web/AnyServlet.java 2009-10-27 15:19:01 UTC (rev 95612)
@@ -21,6 +21,8 @@
*/
package org.jboss.test.deployers.vfs.classpool.support.web;
+import org.jboss.test.deployers.vfs.classpool.support.jar.PlainJavaBean;
+
/**
*
* @author <a href="mailto:flavia.rainone at jboss.org">Flavia Rainone</a>
@@ -29,4 +31,8 @@
*/
public class AnyServlet
{
+ public PlainJavaBean getBean()
+ {
+ return new PlainJavaBean();
+ }
}
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTest.java 2009-10-27 15:11:07 UTC (rev 95611)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTest.java 2009-10-27 15:19:01 UTC (rev 95612)
@@ -21,9 +21,9 @@
*/
package org.jboss.test.deployers.vfs.classpool.test;
+import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import java.util.HashMap;
import org.jboss.classloader.plugins.jdk.AbstractJDKChecker;
import org.jboss.deployers.structure.spi.DeploymentUnit;
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.java 2009-10-27 15:11:07 UTC (rev 95611)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.java 2009-10-27 15:19:01 UTC (rev 95612)
@@ -26,6 +26,12 @@
import java.util.Map;
import junit.framework.Test;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
+import org.jboss.reflect.spi.ClassInfo;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.reflect.spi.TypeInfoFactory;
import org.jboss.test.deployers.vfs.classpool.support.crm.CrmFacade;
import org.jboss.test.deployers.vfs.classpool.support.ejb.MySLSBean;
import org.jboss.test.deployers.vfs.classpool.support.ext.External;
@@ -112,7 +118,32 @@
AssembledDirectory directory = createJarInEar();
assertClassPool(directory, PlainJavaBean.class);
}
-
+
+ /**
+ * FIXME -- classpools issue?
+ */
+ public void testHierarchyCLUsage() throws Exception
+ {
+ AssembledDirectory directory = createBasicEar();
+ DeploymentUnit unit = assertDeploy(directory);
+ try
+ {
+ TypeInfoFactory typeInfoFactory = new JavassistTypeInfoFactory();
+ DeploymentUnit child = getDeploymentUnit(unit, "simple.war");
+ ClassLoader cl = getClassLoader(child);
+ TypeInfo ti = typeInfoFactory.getTypeInfo(AnyServlet.class.getName(), cl);
+ ClassInfo ci = assertInstanceOf(ti, ClassInfo.class);
+ MethodInfo mi = ci.getDeclaredMethod("getBean");
+ TypeInfo rt = mi.getReturnType();
+ TypeInfo cti = typeInfoFactory.getTypeInfo(PlainJavaBean.class.getName(), getClassLoader(unit));
+ assertSame(rt, cti);
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+
private AssembledDirectory createJar() throws Exception
{
AssembledDirectory jar = createAssembledDirectory("simple.jar", "simple.jar");
More information about the jboss-cvs-commits
mailing list