[jboss-cvs] JBossAS SVN: r95629 - in projects/jboss-deployers/trunk/deployers-vfs/src: test/java/org/jboss/test/deployers and 16 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 27 16:45:08 EDT 2009
Author: alesj
Date: 2009-10-27 16:45:07 -0400 (Tue, 27 Oct 2009)
New Revision: 95629
Added:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ReflectTestSuite.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/PoolFactoryInitializer.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/web/AnyServlet.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ReflectTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/TypeInfoTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.xml
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.xml
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/reflect/
Removed:
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ClassPoolTestSuite.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/PoolFactoryInitializer.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/web/AnyServlet.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/classpool/
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/classpool/
Modified:
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/MockWarClassLoaderDeployer.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/crm/CrmFacade.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ejb/BusinessInterface.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ejb/MySLSBean.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ext/External.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/jar/PlainJavaBean.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/jsf/JsfBean.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/service/SomeMBean.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ui/UIBean.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/util/SomeUtil.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.xml
Log:
Separate Classpool tests from Reflect tests.
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java 2009-10-27 20:38:44 UTC (rev 95628)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/deployer/kernel/BeanMetaDataDeployer.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -24,6 +24,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.List;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -51,6 +52,7 @@
* type {@link org.jboss.beans.metadata.spi.BeanMetaData}.
*
* @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
* @version $Revision: 1.1 $
*/
public class BeanMetaDataDeployer extends AbstractSimpleRealDeployer<BeanMetaData>
@@ -59,13 +61,10 @@
private Controller controller;
/** List of controller context creators */
- private ArrayList<KernelControllerContextCreator> controllerContextCreators = new ArrayList<KernelControllerContextCreator>();
+ private List<KernelControllerContextCreator> controllerContextCreators = new ArrayList<KernelControllerContextCreator>();
private ReadWriteLock lock = new ReentrantReadWriteLock();
-
- /** The default controller context creator */
-
-
+
/**
* Create a new BeanDeployer.
*
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-10-27 20:38:44 UTC (rev 95628)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -26,7 +26,7 @@
import junit.textui.TestRunner;
import org.jboss.test.deployers.vfs.annotations.AnnotationScanningTestSuite;
import org.jboss.test.deployers.vfs.classloader.ClassLoaderTestSuite;
-import org.jboss.test.deployers.vfs.classpool.ClassPoolTestSuite;
+import org.jboss.test.deployers.vfs.reflect.ReflectTestSuite;
import org.jboss.test.deployers.vfs.dependency.DependencyTestSuite;
import org.jboss.test.deployers.vfs.deployer.bean.BeanDeployerTestSuite;
import org.jboss.test.deployers.vfs.deployer.bean.test.KernelControllerContextCreatorTestCase;
@@ -87,7 +87,7 @@
suite.addTest(JMXTestSuite.suite());
suite.addTest(RedeployTestSuite.suite());
suite.addTest(WebBeansTestSuite.suite()); // now Weld
- suite.addTest(ClassPoolTestSuite.suite());
+ suite.addTest(ReflectTestSuite.suite());
return suite;
}
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect (from rev 95610, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool)
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ClassPoolTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/ClassPoolTestSuite.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ClassPoolTestSuite.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.deployers.vfs.classpool;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.jboss.test.deployers.vfs.classpool.test.ClassPoolTestCase;
-
-/**
- * ClassPool test suite.
- *
- * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
- */
-public class ClassPoolTestSuite extends TestSuite
-{
- public static void main(String[] args)
- {
- TestRunner.run(suite());
- }
-
- public static Test suite()
- {
- TestSuite suite = new TestSuite("VFS ClassPoolTests");
-
- suite.addTest(ClassPoolTestCase.suite());
-
- return suite;
- }
-}
\ No newline at end of file
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ReflectTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ReflectTestSuite.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ReflectTestSuite.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.jboss.test.deployers.vfs.reflect.test.ClassPoolTestCase;
+import org.jboss.test.deployers.vfs.reflect.test.IntrospectionTypeInfoTestCase;
+import org.jboss.test.deployers.vfs.reflect.test.JavassistTypeInfoTestCase;
+
+/**
+ * Reflect test suite.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ReflectTestSuite extends TestSuite
+{
+ public static void main(String[] args)
+ {
+ TestRunner.run(suite());
+ }
+
+ public static Test suite()
+ {
+ TestSuite suite = new TestSuite("VFS ReflectTests");
+
+ suite.addTest(ClassPoolTestCase.suite());
+ suite.addTest(IntrospectionTypeInfoTestCase.suite());
+ suite.addTest(JavassistTypeInfoTestCase.suite());
+
+ return suite;
+ }
+}
\ No newline at end of file
Property changes on: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/ReflectTestSuite.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/MockWarClassLoaderDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/MockWarClassLoaderDeployer.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/MockWarClassLoaderDeployer.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support;
+package org.jboss.test.deployers.vfs.reflect.support;
import org.jboss.classloader.spi.filter.ClassFilter;
import org.jboss.classloader.spi.filter.RecursivePackageClassFilter;
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/PoolFactoryInitializer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/PoolFactoryInitializer.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/PoolFactoryInitializer.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.deployers.vfs.classpool.support;
-
-import javassist.scopedpool.ScopedClassPoolFactory;
-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.JavassistTypeInfoFactoryImpl;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class PoolFactoryInitializer
-{
- private ScopedClassPoolFactory poolFactory;
-
- public PoolFactoryInitializer(ScopedClassPoolFactory poolFactory)
- {
- this.poolFactory = poolFactory;
- }
-
- public void start()
- {
- ClassPoolRepository repository = ClassPoolRepository.getInstance();
- repository.setClassPoolFactory(poolFactory);
- ClassPoolFactory classPoolFactory = new RepositoryClassPoolFactory(repository);
- JavassistTypeInfoFactoryImpl.setPoolFactory(classPoolFactory);
- }
-}
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/PoolFactoryInitializer.java (from rev 95612, 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/reflect/support/PoolFactoryInitializer.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/PoolFactoryInitializer.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.support;
+
+import javassist.scopedpool.ScopedClassPoolFactory;
+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;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class PoolFactoryInitializer
+{
+ private ScopedClassPoolFactory poolFactory;
+
+ public PoolFactoryInitializer(ScopedClassPoolFactory poolFactory)
+ {
+ this.poolFactory = poolFactory;
+ }
+
+ public void start()
+ {
+ ClassPoolRepository repository = ClassPoolRepository.getInstance();
+ repository.setClassPoolFactory(poolFactory);
+ 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/reflect/support/crm/CrmFacade.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/crm/CrmFacade.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/crm/CrmFacade.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.crm;
+package org.jboss.test.deployers.vfs.reflect.support.crm;
/**
*
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ejb/BusinessInterface.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/ejb/BusinessInterface.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ejb/BusinessInterface.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.ejb;
+package org.jboss.test.deployers.vfs.reflect.support.ejb;
/**
* @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ejb/MySLSBean.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/ejb/MySLSBean.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ejb/MySLSBean.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.ejb;
+package org.jboss.test.deployers.vfs.reflect.support.ejb;
/**
* @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ext/External.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/ext/External.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ext/External.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.ext;
+package org.jboss.test.deployers.vfs.reflect.support.ext;
/**
* @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/jar/PlainJavaBean.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/jar/PlainJavaBean.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/jar/PlainJavaBean.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.jar;
+package org.jboss.test.deployers.vfs.reflect.support.jar;
/**
* @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/jsf/JsfBean.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/jsf/JsfBean.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/jsf/JsfBean.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.jsf;
+package org.jboss.test.deployers.vfs.reflect.support.jsf;
/**
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/service/SomeMBean.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/service/SomeMBean.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/service/SomeMBean.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.service;
+package org.jboss.test.deployers.vfs.reflect.support.service;
/**
*
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ui/UIBean.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/ui/UIBean.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/ui/UIBean.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.ui;
+package org.jboss.test.deployers.vfs.reflect.support.ui;
/**
*
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/util/SomeUtil.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/support/util/SomeUtil.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/util/SomeUtil.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -19,7 +19,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
-package org.jboss.test.deployers.vfs.classpool.support.util;
+package org.jboss.test.deployers.vfs.reflect.support.util;
/**
* @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/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 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/web/AnyServlet.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.deployers.vfs.classpool.support.web;
-
-/**
- *
- * @author <a href="mailto:flavia.rainone at jboss.org">Flavia Rainone</a>
- *
- * @version $Revision$
- */
-public class AnyServlet
-{
-}
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/web/AnyServlet.java (from rev 95612, 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/reflect/support/web/AnyServlet.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/support/web/AnyServlet.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.support.web;
+
+import org.jboss.test.deployers.vfs.reflect.support.jar.PlainJavaBean;
+
+/**
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.org">Flavia Rainone</a>
+ *
+ * @version $Revision$
+ */
+public class AnyServlet
+{
+ public PlainJavaBean getBean()
+ {
+ return new PlainJavaBean();
+ }
+}
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTest.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTest.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.deployers.vfs.classpool.test;
-
-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;
-import org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor;
-import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
-import org.jboss.reflect.spi.TypeInfo;
-import org.jboss.reflect.spi.TypeInfoFactory;
-import org.jboss.test.deployers.BootstrapDeployersTest;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Abstract test for ClassPool.
- *
- * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- *
- * @version $Revision$
- */
-public abstract class ClassPoolTest extends BootstrapDeployersTest
-{
- protected ClassPoolTest(String name)
- {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception
- {
- // excluding class that knows hot to load from system classloader
- Set<Class<?>> excluded = AbstractJDKChecker.getExcluded();
- excluded.add(BeanMetaDataFactoryVisitor.class);
-
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- super.tearDown();
- // reverting exclusion performed on setUp
- Set<Class<?>> excluded = AbstractJDKChecker.getExcluded();
- excluded.remove(BeanMetaDataFactoryVisitor.class);
- }
-
- protected void assertClassPool(VirtualFile file, Class<?> ... classes) throws Exception
- {
- Map<Class<?>, String> map = new HashMap<Class<?>, String>();
- for (Class<?> clazz : classes)
- {
- map.put(clazz, null);
- }
- assertClassPool(file, map);
- }
-
- protected void assertClassPool(VirtualFile file, Map<Class<?>, String> classes) throws Exception
- {
- DeploymentUnit unit = assertDeploy(file);
- try
- {
- TypeInfoFactory typeInfoFactory = new JavassistTypeInfoFactory();
- for (Map.Entry<Class<?>, String> entry : classes.entrySet())
- {
- DeploymentUnit du = getDeploymentUnit(unit, entry.getValue());
- ClassLoader classLoader = getClassLoader(du);
- Class<?> clazz = entry.getKey();
- String className = clazz.getName();
- assertLoadClass(className, classLoader);
- TypeInfo typeInfo = typeInfoFactory.getTypeInfo(className, classLoader);
- assertEquals(className, typeInfo.getName());
- ClassLoader cl = typeInfo.getClassLoader();
- assertEquals(classLoader, cl);
- }
- }
- finally
- {
- undeploy(unit);
- }
- }
-
- protected DeploymentUnit getDeploymentUnit(DeploymentUnit parent, String name)
- {
- if (name == null || "".equals(name))
- return parent;
-
- return assertChild(parent, name);
- }
-}
\ No newline at end of file
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTest.java (from rev 95612, 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/reflect/test/ClassPoolTest.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTest.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.reflect.spi.TypeInfoFactory;
+import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
+
+/**
+ * Abstract test for ClassPool.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ *
+ * @version $Revision$
+ */
+public abstract class ClassPoolTest extends ReflectTest
+{
+ protected ClassPoolTest(String name)
+ {
+ super(name);
+ }
+
+ protected TypeInfoFactory createTypeInfoFactory()
+ {
+ return new JavassistTypeInfoFactory();
+ }
+
+ protected void assertClassPool(VirtualFile file, Class<?> ... classes) throws Exception
+ {
+ Map<Class<?>, String> map = new HashMap<Class<?>, String>();
+ for (Class<?> clazz : classes)
+ {
+ map.put(clazz, null);
+ }
+ assertClassPool(file, map);
+ }
+
+ protected void assertClassPool(VirtualFile file, Map<Class<?>, String> classes) throws Exception
+ {
+ DeploymentUnit unit = assertDeploy(file);
+ try
+ {
+ // TODO - actually test *just* classpools
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+}
\ No newline at end of file
Deleted: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.java 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -1,233 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.deployers.vfs.classpool.test;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.Test;
-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;
-import org.jboss.test.deployers.vfs.classpool.support.jar.PlainJavaBean;
-import org.jboss.test.deployers.vfs.classpool.support.jsf.JsfBean;
-import org.jboss.test.deployers.vfs.classpool.support.service.SomeMBean;
-import org.jboss.test.deployers.vfs.classpool.support.ui.UIBean;
-import org.jboss.test.deployers.vfs.classpool.support.util.SomeUtil;
-import org.jboss.test.deployers.vfs.classpool.support.web.AnyServlet;
-import org.jboss.virtual.AssembledDirectory;
-
-/**
- * Test case for ClassPool.
- *
- * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
- *
- * @version $Revision$
- */
-public class ClassPoolTestCase extends ClassPoolTest
-{
- public ClassPoolTestCase(String name)
- {
- super(name);
- }
-
- public static Test suite()
- {
- return suite(ClassPoolTestCase.class);
- }
-
- public void testJar() throws Exception
- {
- AssembledDirectory directory = createJar();
- assertClassPool(directory, PlainJavaBean.class);
- }
-
- public void testEjbJar() throws Exception
- {
- AssembledDirectory directory = createEjbJar();
- assertClassPool(directory, MySLSBean.class);
- }
-
- public void testWar() throws Exception
- {
- AssembledDirectory directory = createWar();
- assertClassPool(directory, AnyServlet.class);
- }
-
- public void testSar() throws Exception
- {
- AssembledDirectory directory = createSar();
- assertClassPool(directory, SomeMBean.class);
- }
-
- public void testBasicEar() throws Exception
- {
- AssembledDirectory directory = createBasicEar();
- Map<Class<?>, String> classes = new HashMap<Class<?>, String>();
- classes.put(SomeUtil.class, null);
- classes.put(PlainJavaBean.class, null);
- classes.put(MySLSBean.class, null);
- classes.put(AnyServlet.class, "simple.war");
- classes.put(UIBean.class, "simple.war");
- classes.put(JsfBean.class, "jsfapp.war");
- classes.put(CrmFacade.class, "jsfapp.war");
- classes.put(SomeMBean.class, null);
- assertClassPool(directory, classes);
- }
-
- public void testTopLevelWithUtil() throws Exception
- {
- AssembledDirectory directory = createTopLevelWithUtil("/classpool/earutil");
- assertClassPool(directory, SomeUtil.class, External.class);
- }
-
- public void testWarInEar() throws Exception
- {
- AssembledDirectory directory = createWarInEar();
- assertClassPool(directory, Collections.<Class<?>, String>singletonMap(AnyServlet.class, "simple.war"));
- }
-
- public void testJarInEar() throws Exception
- {
- AssembledDirectory directory = createJarInEar();
- assertClassPool(directory, PlainJavaBean.class);
- }
-
- private AssembledDirectory createJar() throws Exception
- {
- AssembledDirectory jar = createAssembledDirectory("simple.jar", "simple.jar");
- addPackage(jar, PlainJavaBean.class);
- return jar;
- }
-
- private AssembledDirectory createEjbJar() throws Exception
- {
- AssembledDirectory jar = createAssembledDirectory("ejbs.jar", "ejbs.jar");
- addPackage(jar, MySLSBean.class);
-
- addPath(jar, "/classpool/ejb", "META-INF");
- return jar;
- }
-
- private AssembledDirectory createWar() throws Exception
- {
- AssembledDirectory war = createAssembledDirectory("simple.war", "simple.war");
- AssembledDirectory webinf = war.mkdir("WEB-INF");
- AssembledDirectory classes = webinf.mkdir("classes");
- addPackage(classes, AnyServlet.class);
- addPath(war, "/classpool/web", "WEB-INF");
- return war;
- }
-
- private AssembledDirectory createSar() throws Exception
- {
- AssembledDirectory sar = createAssembledDirectory("simple.sar", "simple.sar");
- addPackage(sar, SomeMBean.class);
- return sar;
- }
-
- private AssembledDirectory createBasicEar() throws Exception
- {
- AssembledDirectory ear = createTopLevelWithUtil("/classpool/simple");
-
- AssembledDirectory jar = ear.mkdir("simple.jar");
- addPackage(jar, PlainJavaBean.class);
-
- AssembledDirectory ejbs = ear.mkdir("ejbs.jar");
- addPackage(ejbs, MySLSBean.class);
- addPath(ejbs, "/classpool/ejb", "META-INF");
-
- AssembledDirectory war = ear.mkdir("simple.war");
- AssembledDirectory webinf = war.mkdir("WEB-INF");
- AssembledDirectory classes = webinf.mkdir("classes");
- addPackage(classes, AnyServlet.class);
- addPath(war, "/classpool/web", "WEB-INF");
-
- AssembledDirectory lib = webinf.mkdir("lib");
-
- AssembledDirectory uijar = lib.mkdir("ui.jar");
- addPackage(uijar, UIBean.class);
-
- // another war
- war = ear.mkdir("jsfapp.war");
- webinf = war.mkdir("WEB-INF");
- addPath(war, "/classpool/web", "WEB-INF");
- classes = webinf.mkdir("classes");
- addPackage(classes, JsfBean.class);
-
- lib = webinf.mkdir("lib");
-
- uijar = lib.mkdir("ui_util.jar");
- addPackage(uijar, CrmFacade.class);
-
- // a sar
- AssembledDirectory sar = ear.mkdir("simple.sar");
- addPackage(sar, SomeMBean.class);
- addPath(war, "/classpool/sar", "META-INF");
-
- enableTrace("org.jboss.deployers");
-
- return ear;
- }
-
- private AssembledDirectory createTopLevelWithUtil(String path) throws Exception
- {
- AssembledDirectory topLevel = createAssembledDirectory("top-level.ear", "top-level.ear");
- addPath(topLevel, path, "META-INF");
-
- AssembledDirectory earLib = topLevel.mkdir("lib");
-
- AssembledDirectory util = earLib.mkdir("util.jar");
- addPackage(util, SomeUtil.class);
-
- AssembledDirectory ext = earLib.mkdir("ext.jar");
- addPackage(ext, External.class);
-
- return topLevel;
- }
-
- private AssembledDirectory createWarInEar() throws Exception
- {
- AssembledDirectory ear = createAssembledDirectory("war-in-ear.ear", "war-in-ear.ear");
- addPath(ear, "/classpool/warinear", "META-INF");
-
- AssembledDirectory war = ear.mkdir("simple.war");
- AssembledDirectory webinf = war.mkdir("WEB-INF");
- AssembledDirectory classes = webinf.mkdir("classes");
- addPackage(classes, AnyServlet.class);
- addPath(war, "/classpool/web", "WEB-INF");
-
- return ear;
- }
-
- private AssembledDirectory createJarInEar() throws Exception
- {
- AssembledDirectory ear = createAssembledDirectory("jar-in-ear.ear", "jar-in-ear.ear");
- addPath(ear, "/classpool/jarinear", "META-INF");
-
- AssembledDirectory jar = ear.mkdir("simple.jar");
- addPackage(jar, PlainJavaBean.class);
-
- return ear;
- }
-}
\ No newline at end of file
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.java (from rev 95613, 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/reflect/test/ClassPoolTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,133 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Test;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.test.deployers.vfs.reflect.support.crm.CrmFacade;
+import org.jboss.test.deployers.vfs.reflect.support.ejb.MySLSBean;
+import org.jboss.test.deployers.vfs.reflect.support.ext.External;
+import org.jboss.test.deployers.vfs.reflect.support.jar.PlainJavaBean;
+import org.jboss.test.deployers.vfs.reflect.support.jsf.JsfBean;
+import org.jboss.test.deployers.vfs.reflect.support.service.SomeMBean;
+import org.jboss.test.deployers.vfs.reflect.support.ui.UIBean;
+import org.jboss.test.deployers.vfs.reflect.support.util.SomeUtil;
+import org.jboss.test.deployers.vfs.reflect.support.web.AnyServlet;
+import org.jboss.virtual.AssembledDirectory;
+
+/**
+ * Test case for ClassPool.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ *
+ * @version $Revision$
+ */
+public class ClassPoolTestCase extends ClassPoolTest
+{
+ public ClassPoolTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(ClassPoolTestCase.class);
+ }
+
+ public void testJar() throws Exception
+ {
+ AssembledDirectory directory = createJar();
+ assertClassPool(directory, PlainJavaBean.class);
+ }
+
+ public void testEjbJar() throws Exception
+ {
+ AssembledDirectory directory = createEjbJar();
+ assertClassPool(directory, MySLSBean.class);
+ }
+
+ public void testWar() throws Exception
+ {
+ AssembledDirectory directory = createWar();
+ assertClassPool(directory, AnyServlet.class);
+ }
+
+ public void testSar() throws Exception
+ {
+ AssembledDirectory directory = createSar();
+ assertClassPool(directory, SomeMBean.class);
+ }
+
+ public void testBasicEar() throws Exception
+ {
+ AssembledDirectory directory = createBasicEar();
+ Map<Class<?>, String> classes = new HashMap<Class<?>, String>();
+ classes.put(SomeUtil.class, null);
+ classes.put(PlainJavaBean.class, null);
+ classes.put(MySLSBean.class, null);
+ classes.put(AnyServlet.class, "simple.war");
+ classes.put(UIBean.class, "simple.war");
+ classes.put(JsfBean.class, "jsfapp.war");
+ classes.put(CrmFacade.class, "jsfapp.war");
+ classes.put(SomeMBean.class, null);
+ assertClassPool(directory, classes);
+ }
+
+ public void testTopLevelWithUtil() throws Exception
+ {
+ AssembledDirectory directory = createTopLevelWithUtil("/reflect/earutil");
+ assertClassPool(directory, SomeUtil.class, External.class);
+ }
+
+ public void testWarInEar() throws Exception
+ {
+ AssembledDirectory directory = createWarInEar();
+ assertClassPool(directory, Collections.<Class<?>, String>singletonMap(AnyServlet.class, "simple.war"));
+ }
+
+ public void testJarInEar() throws Exception
+ {
+ AssembledDirectory directory = createJarInEar();
+ assertClassPool(directory, PlainJavaBean.class);
+ }
+
+ /**
+ * FIXME -- classpools issue?
+ */
+ public void testHierarchyCLUsage() throws Exception
+ {
+ AssembledDirectory directory = createBasicEar();
+ DeploymentUnit unit = assertDeploy(directory);
+ try
+ {
+ // TODO - test just classpools
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+}
\ No newline at end of file
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.test;
+
+import junit.framework.Test;
+import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory;
+import org.jboss.reflect.spi.TypeInfoFactory;
+
+/**
+ * Introspection test case for TypeInfo.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ *
+ * @version $Revision: 95613 $
+ */
+public class IntrospectionTypeInfoTestCase extends TypeInfoTest
+{
+ public IntrospectionTypeInfoTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(IntrospectionTypeInfoTestCase.class);
+ }
+
+ protected TypeInfoFactory createTypeInfoFactory()
+ {
+ return new IntrospectionTypeInfoFactory();
+ }
+}
\ No newline at end of file
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.test;
+
+import junit.framework.Test;
+import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory;
+import org.jboss.reflect.spi.TypeInfoFactory;
+
+/**
+ * Javassist test case for TypeInfo.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ *
+ * @version $Revision: 95613 $
+ */
+public class JavassistTypeInfoTestCase extends TypeInfoTest
+{
+ public JavassistTypeInfoTestCase(String name)
+ {
+ super(name);
+ }
+
+ public static Test suite()
+ {
+ return suite(JavassistTypeInfoTestCase.class);
+ }
+
+ protected TypeInfoFactory createTypeInfoFactory()
+ {
+ return new JavassistTypeInfoFactory();
+ }
+
+ @Override
+ public void testHierarchyCLUsage() throws Exception
+ {
+ // FIXME -- fix Classpool's hierarchy usage
+ }
+}
\ No newline at end of file
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ReflectTest.java (from rev 95610, 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/reflect/test/ReflectTest.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/ReflectTest.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,242 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.test;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.classloader.plugins.jdk.AbstractJDKChecker;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor;
+import org.jboss.reflect.spi.TypeInfo;
+import org.jboss.reflect.spi.TypeInfoFactory;
+import org.jboss.test.deployers.BootstrapDeployersTest;
+import org.jboss.test.deployers.vfs.reflect.support.jar.PlainJavaBean;
+import org.jboss.test.deployers.vfs.reflect.support.ejb.MySLSBean;
+import org.jboss.test.deployers.vfs.reflect.support.web.AnyServlet;
+import org.jboss.test.deployers.vfs.reflect.support.service.SomeMBean;
+import org.jboss.test.deployers.vfs.reflect.support.ui.UIBean;
+import org.jboss.test.deployers.vfs.reflect.support.jsf.JsfBean;
+import org.jboss.test.deployers.vfs.reflect.support.crm.CrmFacade;
+import org.jboss.test.deployers.vfs.reflect.support.util.SomeUtil;
+import org.jboss.test.deployers.vfs.reflect.support.ext.External;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.AssembledDirectory;
+
+/**
+ * Abstract test for Reflect.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ *
+ * @version $Revision$
+ */
+public abstract class ReflectTest extends BootstrapDeployersTest
+{
+ protected ReflectTest(String name)
+ {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ // excluding class that knows hot to load from system classloader
+ Set<Class<?>> excluded = AbstractJDKChecker.getExcluded();
+ excluded.add(BeanMetaDataFactoryVisitor.class);
+
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+
+ // reverting exclusion performed on setUp
+ Set<Class<?>> excluded = AbstractJDKChecker.getExcluded();
+ excluded.remove(BeanMetaDataFactoryVisitor.class);
+ }
+
+ protected abstract TypeInfoFactory createTypeInfoFactory();
+
+ protected void assertTypeInfo(VirtualFile file, Class<?> ... classes) throws Exception
+ {
+ Map<Class<?>, String> map = new HashMap<Class<?>, String>();
+ for (Class<?> clazz : classes)
+ {
+ map.put(clazz, null);
+ }
+ assertTypeInfo(file, map);
+ }
+
+ protected void assertTypeInfo(VirtualFile file, Map<Class<?>, String> classes) throws Exception
+ {
+ DeploymentUnit unit = assertDeploy(file);
+ try
+ {
+ TypeInfoFactory typeInfoFactory = createTypeInfoFactory();
+ for (Map.Entry<Class<?>, String> entry : classes.entrySet())
+ {
+ DeploymentUnit du = getDeploymentUnit(unit, entry.getValue());
+ ClassLoader classLoader = getClassLoader(du);
+ Class<?> clazz = entry.getKey();
+ String className = clazz.getName();
+ assertLoadClass(className, classLoader);
+ TypeInfo typeInfo = typeInfoFactory.getTypeInfo(className, classLoader);
+ assertEquals(className, typeInfo.getName());
+ ClassLoader cl = typeInfo.getClassLoader();
+ assertEquals(classLoader, cl);
+ }
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+
+ protected DeploymentUnit getDeploymentUnit(DeploymentUnit parent, String name)
+ {
+ if (name == null || "".equals(name))
+ return parent;
+
+ return assertChild(parent, name);
+ }
+
+ protected AssembledDirectory createJar() throws Exception
+ {
+ AssembledDirectory jar = createAssembledDirectory("simple.jar", "simple.jar");
+ addPackage(jar, PlainJavaBean.class);
+ return jar;
+ }
+
+ protected AssembledDirectory createEjbJar() throws Exception
+ {
+ AssembledDirectory jar = createAssembledDirectory("ejbs.jar", "ejbs.jar");
+ addPackage(jar, MySLSBean.class);
+
+ addPath(jar, "/reflect/ejb", "META-INF");
+ return jar;
+ }
+
+ protected AssembledDirectory createWar() throws Exception
+ {
+ AssembledDirectory war = createAssembledDirectory("simple.war", "simple.war");
+ AssembledDirectory webinf = war.mkdir("WEB-INF");
+ AssembledDirectory classes = webinf.mkdir("classes");
+ addPackage(classes, AnyServlet.class);
+ addPath(war, "/reflect/web", "WEB-INF");
+ return war;
+ }
+
+ protected AssembledDirectory createSar() throws Exception
+ {
+ AssembledDirectory sar = createAssembledDirectory("simple.sar", "simple.sar");
+ addPackage(sar, SomeMBean.class);
+ return sar;
+ }
+
+ protected AssembledDirectory createBasicEar() throws Exception
+ {
+ AssembledDirectory ear = createTopLevelWithUtil("/reflect/simple");
+
+ AssembledDirectory jar = ear.mkdir("simple.jar");
+ addPackage(jar, PlainJavaBean.class);
+
+ AssembledDirectory ejbs = ear.mkdir("ejbs.jar");
+ addPackage(ejbs, MySLSBean.class);
+ addPath(ejbs, "/reflect/ejb", "META-INF");
+
+ AssembledDirectory war = ear.mkdir("simple.war");
+ AssembledDirectory webinf = war.mkdir("WEB-INF");
+ AssembledDirectory classes = webinf.mkdir("classes");
+ addPackage(classes, AnyServlet.class);
+ addPath(war, "/reflect/web", "WEB-INF");
+
+ AssembledDirectory lib = webinf.mkdir("lib");
+
+ AssembledDirectory uijar = lib.mkdir("ui.jar");
+ addPackage(uijar, UIBean.class);
+
+ // another war
+ war = ear.mkdir("jsfapp.war");
+ webinf = war.mkdir("WEB-INF");
+ addPath(war, "/reflect/web", "WEB-INF");
+ classes = webinf.mkdir("classes");
+ addPackage(classes, JsfBean.class);
+
+ lib = webinf.mkdir("lib");
+
+ uijar = lib.mkdir("ui_util.jar");
+ addPackage(uijar, CrmFacade.class);
+
+ // a sar
+ AssembledDirectory sar = ear.mkdir("simple.sar");
+ addPackage(sar, SomeMBean.class);
+ addPath(war, "/reflect/sar", "META-INF");
+
+ enableTrace("org.jboss.deployers");
+
+ return ear;
+ }
+
+ protected AssembledDirectory createTopLevelWithUtil(String path) throws Exception
+ {
+ AssembledDirectory topLevel = createAssembledDirectory("top-level.ear", "top-level.ear");
+ addPath(topLevel, path, "META-INF");
+
+ AssembledDirectory earLib = topLevel.mkdir("lib");
+
+ AssembledDirectory util = earLib.mkdir("util.jar");
+ addPackage(util, SomeUtil.class);
+
+ AssembledDirectory ext = earLib.mkdir("ext.jar");
+ addPackage(ext, External.class);
+
+ return topLevel;
+ }
+
+ protected AssembledDirectory createWarInEar() throws Exception
+ {
+ AssembledDirectory ear = createAssembledDirectory("war-in-ear.ear", "war-in-ear.ear");
+ addPath(ear, "/reflect/warinear", "META-INF");
+
+ AssembledDirectory war = ear.mkdir("simple.war");
+ AssembledDirectory webinf = war.mkdir("WEB-INF");
+ AssembledDirectory classes = webinf.mkdir("classes");
+ addPackage(classes, AnyServlet.class);
+ addPath(war, "/reflect/web", "WEB-INF");
+
+ return ear;
+ }
+
+ protected AssembledDirectory createJarInEar() throws Exception
+ {
+ AssembledDirectory ear = createAssembledDirectory("jar-in-ear.ear", "jar-in-ear.ear");
+ addPath(ear, "/reflect/jarinear", "META-INF");
+
+ AssembledDirectory jar = ear.mkdir("simple.jar");
+ addPackage(jar, PlainJavaBean.class);
+
+ return ear;
+ }
+}
\ No newline at end of file
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/TypeInfoTest.java (from rev 95610, 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/reflect/test/TypeInfoTest.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/reflect/test/TypeInfoTest.java 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.deployers.vfs.reflect.test;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+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.reflect.support.crm.CrmFacade;
+import org.jboss.test.deployers.vfs.reflect.support.ejb.MySLSBean;
+import org.jboss.test.deployers.vfs.reflect.support.ext.External;
+import org.jboss.test.deployers.vfs.reflect.support.jar.PlainJavaBean;
+import org.jboss.test.deployers.vfs.reflect.support.jsf.JsfBean;
+import org.jboss.test.deployers.vfs.reflect.support.service.SomeMBean;
+import org.jboss.test.deployers.vfs.reflect.support.ui.UIBean;
+import org.jboss.test.deployers.vfs.reflect.support.util.SomeUtil;
+import org.jboss.test.deployers.vfs.reflect.support.web.AnyServlet;
+import org.jboss.virtual.AssembledDirectory;
+
+/**
+ * Test case for TypeInfo.
+ *
+ * @author <a href="mailto:flavia.rainone at jboss.com">Flavia Rainone</a>
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ *
+ * @version $Revision$
+ */
+public abstract class TypeInfoTest extends ReflectTest
+{
+ public TypeInfoTest(String name)
+ {
+ super(name);
+ }
+
+ public void testJar() throws Exception
+ {
+ AssembledDirectory directory = createJar();
+ assertTypeInfo(directory, PlainJavaBean.class);
+ }
+
+ public void testEjbJar() throws Exception
+ {
+ AssembledDirectory directory = createEjbJar();
+ assertTypeInfo(directory, MySLSBean.class);
+ }
+
+ public void testWar() throws Exception
+ {
+ AssembledDirectory directory = createWar();
+ assertTypeInfo(directory, AnyServlet.class);
+ }
+
+ public void testSar() throws Exception
+ {
+ AssembledDirectory directory = createSar();
+ assertTypeInfo(directory, SomeMBean.class);
+ }
+
+ public void testBasicEar() throws Exception
+ {
+ AssembledDirectory directory = createBasicEar();
+ Map<Class<?>, String> classes = new HashMap<Class<?>, String>();
+ classes.put(SomeUtil.class, null);
+ classes.put(PlainJavaBean.class, null);
+ classes.put(MySLSBean.class, null);
+ classes.put(AnyServlet.class, "simple.war");
+ classes.put(UIBean.class, "simple.war");
+ classes.put(JsfBean.class, "jsfapp.war");
+ classes.put(CrmFacade.class, "jsfapp.war");
+ classes.put(SomeMBean.class, null);
+ assertTypeInfo(directory, classes);
+ }
+
+ public void testTopLevelWithUtil() throws Exception
+ {
+ AssembledDirectory directory = createTopLevelWithUtil("/reflect/earutil");
+ assertTypeInfo(directory, SomeUtil.class, External.class);
+ }
+
+ public void testWarInEar() throws Exception
+ {
+ AssembledDirectory directory = createWarInEar();
+ assertTypeInfo(directory, Collections.<Class<?>, String>singletonMap(AnyServlet.class, "simple.war"));
+ }
+
+ public void testJarInEar() throws Exception
+ {
+ AssembledDirectory directory = createJarInEar();
+ assertTypeInfo(directory, PlainJavaBean.class);
+ }
+
+ /**
+ * FIXME -- classpools issue?
+ */
+ public void testHierarchyCLUsage() throws Exception
+ {
+ AssembledDirectory directory = createBasicEar();
+ DeploymentUnit unit = assertDeploy(directory);
+ try
+ {
+ TypeInfoFactory typeInfoFactory = createTypeInfoFactory();
+ 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");
+ assertNotNull("No such 'getBean' method on " + ci, mi);
+ TypeInfo rt = mi.getReturnType();
+ TypeInfo cti = typeInfoFactory.getTypeInfo(PlainJavaBean.class.getName(), getClassLoader(unit));
+ assertSame(rt, cti);
+ }
+ finally
+ {
+ undeploy(unit);
+ }
+ }
+}
\ No newline at end of file
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect (from rev 95610, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/classpool)
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.xml 2009-10-27 13:53:37 UTC (rev 95610)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/ClassPoolTestCase.xml 2009-10-27 20:45:07 UTC (rev 95629)
@@ -2,7 +2,7 @@
<bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
<bean name="WarStructure" class="org.jboss.test.deployers.vfs.structure.war.support.MockWarStructureDeployer"/>
- <bean name="WarClassLoader" class="org.jboss.test.deployers.vfs.classpool.support.MockWarClassLoaderDeployer"/>
+ <bean name="WarClassLoader" class="org.jboss.test.deployers.vfs.reflect.support.MockWarClassLoaderDeployer"/>
<bean name="ClassLoaderScopingPolicy" class="org.jboss.classpool.plugins.as5.VFSClassLoaderDomainRegistry"/>
@@ -22,7 +22,7 @@
</constructor>
</bean>
- <bean name="PoolFactoryInitializer" class="org.jboss.test.deployers.vfs.classpool.support.PoolFactoryInitializer">
+ <bean name="PoolFactoryInitializer" class="org.jboss.test.deployers.vfs.reflect.support.PoolFactoryInitializer">
<constructor>
<parameter><inject bean="ClassPoolFactory"/></parameter>
</constructor>
Added: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.xml (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/IntrospectionTypeInfoTestCase.xml 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,7 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
+ <bean name="WarStructure" class="org.jboss.test.deployers.vfs.structure.war.support.MockWarStructureDeployer"/>
+ <bean name="WarClassLoader" class="org.jboss.test.deployers.vfs.reflect.support.MockWarClassLoaderDeployer"/>
+
+</deployment>
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.xml (from rev 95610, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/classpool/test/ClassPoolTestCase.xml)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.xml (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/org/jboss/test/deployers/vfs/reflect/test/JavassistTypeInfoTestCase.xml 2009-10-27 20:45:07 UTC (rev 95629)
@@ -0,0 +1,31 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="EarStructure" class="org.jboss.test.deployers.vfs.structure.ear.support.MockEarStructureDeployer"/>
+ <bean name="WarStructure" class="org.jboss.test.deployers.vfs.structure.war.support.MockWarStructureDeployer"/>
+ <bean name="WarClassLoader" class="org.jboss.test.deployers.vfs.reflect.support.MockWarClassLoaderDeployer"/>
+
+ <bean name="ClassLoaderScopingPolicy" class="org.jboss.classpool.plugins.as5.VFSClassLoaderDomainRegistry"/>
+
+ <bean name="RegisterModuleCallback" class="org.jboss.classpool.plugins.as5.RegisterModuleCallback">
+ <install method="addModuleRegistry" bean="ClassLoading" whenRequired="Start">
+ <parameter><this/></parameter>
+ </install>
+ <uninstall method="removeModuleRegistry" bean="ClassLoading" whenRequired="Start">
+ <parameter><this/></parameter>
+ </uninstall>
+ </bean>
+
+ <bean name="ClassPoolFactory" class="org.jboss.classpool.plugins.as5.jbosscl.JBossClDelegatingClassPoolFactory">
+ <constructor>
+ <parameter><inject bean="ClassLoaderScopingPolicy"/></parameter>
+ <parameter><inject bean="RegisterModuleCallback"/></parameter>
+ </constructor>
+ </bean>
+
+ <bean name="PoolFactoryInitializer" class="org.jboss.test.deployers.vfs.reflect.support.PoolFactoryInitializer">
+ <constructor>
+ <parameter><inject bean="ClassPoolFactory"/></parameter>
+ </constructor>
+ </bean>
+
+</deployment>
Copied: projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/reflect (from rev 95610, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/classpool)
More information about the jboss-cvs-commits
mailing list