[jboss-cvs] JBossAS SVN: r95390 - in projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations: test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 22 06:28:59 EDT 2009


Author: alesj
Date: 2009-10-22 06:28:59 -0400 (Thu, 22 Oct 2009)
New Revision: 95390

Added:
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystem.java
Modified:
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystemDeployer.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationEnvTestCase.java
   projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java
Log:
Fix interception usage.

Copied: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystem.java (from rev 95383, projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystemDeployer.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystem.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystem.java	2009-10-22 10:28:59 UTC (rev 95390)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2007, 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.annotations.support;
+
+import org.jboss.classloader.plugins.system.DefaultClassLoaderSystem;
+import org.jboss.classloader.spi.ClassLoaderDomain;
+import org.jboss.classloader.spi.ClassLoaderPolicy;
+
+/**
+ * InterceptionClassLoaderSystemDeployer.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InterceptionClassLoaderSystem extends DefaultClassLoaderSystem
+{
+   @Override
+   public ClassLoader registerClassLoaderPolicy(ClassLoaderDomain domain, ClassLoaderPolicy policy)
+   {
+      return wrapClassLoader(super.registerClassLoaderPolicy(domain, policy));
+   }
+
+   protected ClassLoader wrapClassLoader(ClassLoader loader)
+   {
+      return new InterceptionClassLoader(loader);
+   }
+}
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystemDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystemDeployer.java	2009-10-22 10:03:18 UTC (rev 95389)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/support/InterceptionClassLoaderSystemDeployer.java	2009-10-22 10:28:59 UTC (rev 95390)
@@ -34,12 +34,6 @@
  */
 public class InterceptionClassLoaderSystemDeployer extends AbstractLevelClassLoaderSystemDeployer
 {
-   public ClassLoader createClassLoader(DeploymentUnit unit) throws Exception
-   {
-      ClassLoader loader = super.createClassLoader(unit);
-      return new InterceptionClassLoader(loader);
-   }
-
    @Override
    public void removeClassLoader(DeploymentUnit unit) throws Exception
    {

Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationEnvTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationEnvTestCase.java	2009-10-22 10:03:18 UTC (rev 95389)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationEnvTestCase.java	2009-10-22 10:28:59 UTC (rev 95390)
@@ -152,8 +152,8 @@
          String annotationName = "org.jboss.test.deployers.annotations.support.TestAnnotation";
 
          assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.AnnotationsHolder");
-         // annotations are not loaded, OK?
-         assertNotLoaded(unit, "org.jboss.test.deployers.annotations.support.TestAnnotation");
+         // annotations are loaded, OK?
+         assertLoaded(unit, "org.jboss.test.deployers.annotations.support.TestAnnotation");
 
          AnnotationRepository env = getAnnotationRepository(unit);
          Set<Element<Annotation, Class<?>>> classes = env.classIsAnnotatedWith(annotationName);

Modified: projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java	2009-10-22 10:03:18 UTC (rev 95389)
+++ projects/jboss-deployers/trunk/deployers-impl/src/test/java/org/jboss/test/deployers/annotations/test/AnnotationsTest.java	2009-10-22 10:28:59 UTC (rev 95390)
@@ -25,7 +25,6 @@
 import java.lang.reflect.AnnotatedElement;
 import java.util.Set;
 
-import org.jboss.classloader.plugins.system.DefaultClassLoaderSystem;
 import org.jboss.classloader.spi.ClassLoaderSystem;
 import org.jboss.classloader.spi.ParentPolicy;
 import org.jboss.classloading.spi.dependency.ClassLoading;
@@ -45,8 +44,11 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.mcann.AnnotationRepository;
 import org.jboss.mcann.Element;
+import org.jboss.mcann.repository.DefaultConfiguration;
+import org.jboss.mcann.repository.javassist.JavassistTypeInfoProvider;
 import org.jboss.test.deployers.AbstractDeployerTest;
 import org.jboss.test.deployers.annotations.support.InterceptionClassLoader;
+import org.jboss.test.deployers.annotations.support.InterceptionClassLoaderSystem;
 import org.jboss.test.deployers.annotations.support.InterceptionClassLoaderSystemDeployer;
 import org.jboss.test.deployers.classloading.support.MockClassLoaderDescribeDeployer;
 
@@ -160,7 +162,7 @@
    protected DeployerClient getMainDeployer(Deployer... deployers)
    {
       ClassLoading classLoading = new ClassLoading();
-      ClassLoaderSystem system = new DefaultClassLoaderSystem();
+      ClassLoaderSystem system = new InterceptionClassLoaderSystem();
       system.getDefaultDomain().setParentPolicy(ParentPolicy.BEFORE_BUT_JAVA_ONLY);
 
       deployer1 = new MockClassLoaderDescribeDeployer();
@@ -188,7 +190,9 @@
    protected Deployer createGenericAnnotationDeployer()
    {
       GenericAnnotationDeployer deployer = new GenericAnnotationDeployer();
-      //deployer.setTypeInfoProvider(new JavassistTypeInfoProvider());
+      DefaultConfiguration configuration = new DefaultConfiguration();
+      configuration.setTypeInfoProvider(new JavassistTypeInfoProvider());
+      deployer.setConfiguration(configuration);
       return deployer;
    }
 }




More information about the jboss-cvs-commits mailing list