[jboss-cvs] JBossAS SVN: r70097 - in projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test: microcontainer/jaxb/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 26 08:36:26 EST 2008


Author: kabir.khan at jboss.com
Date: 2008-02-26 08:36:25 -0500 (Tue, 26 Feb 2008)
New Revision: 70097

Added:
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJBossXBAopMicrocontainerTest.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBDeployer.java
Removed:
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java
Modified:
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AOPMicrocontainerTestDelegate.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java
Log:
Rename JAXB to JBossXB

Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AOPMicrocontainerTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AOPMicrocontainerTestDelegate.java	2008-02-26 13:36:20 UTC (rev 70096)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/AOPMicrocontainerTestDelegate.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -124,7 +124,7 @@
    {
       if (useJaxbDeployer)
       {
-         return new JAXBDeployer(kernel, defaultMode, clazz);
+         return new JBossXBDeployer(kernel, defaultMode, clazz);
       }
       return super.createDeployer();
    }
@@ -135,6 +135,6 @@
       {
          throw new IllegalStateException("useJaxbDeployer needs to be true");
       }
-      return ((JAXBDeployer)deployer).unmarshal(url);
+      return ((JBossXBDeployer)deployer).unmarshal(url);
    }
 }

Deleted: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java	2008-02-26 13:36:20 UTC (rev 70096)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, 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.aop.junit;
-
-import java.net.URL;
-
-import org.jboss.kernel.spi.deployment.KernelDeployment;
-import org.jboss.test.AbstractTestDelegate;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class ForceJAXBAOPMicrocontainerTest extends AOPMicrocontainerTest
-{
-   public ForceJAXBAOPMicrocontainerTest(String name)
-   {
-      super(name);
-   }
-
-   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
-   {
-      AOPMicrocontainerTestDelegate delegate = (AOPMicrocontainerTestDelegate)AOPMicrocontainerTest.getDelegate(clazz);
-      delegate.useJaxbDeployer = true;
-      return delegate;
-   }
-
-   protected KernelDeployment unmarshal(final URL url) throws Exception 
-   {
-      return ((AOPMicrocontainerTestDelegate)getDelegate()).unmarshal(url);
-   }
-}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJBossXBAopMicrocontainerTest.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJBossXBAopMicrocontainerTest.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJBossXBAopMicrocontainerTest.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.junit;
+
+import java.net.URL;
+
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.test.AbstractTestDelegate;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ForceJBossXBAopMicrocontainerTest extends AOPMicrocontainerTest
+{
+   public ForceJBossXBAopMicrocontainerTest(String name)
+   {
+      super(name);
+   }
+
+   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+   {
+      AOPMicrocontainerTestDelegate delegate = (AOPMicrocontainerTestDelegate)AOPMicrocontainerTest.getDelegate(clazz);
+      delegate.useJaxbDeployer = true;
+      return delegate;
+   }
+
+   protected KernelDeployment unmarshal(final URL url) throws Exception 
+   {
+      return ((AOPMicrocontainerTestDelegate)getDelegate()).unmarshal(url);
+   }
+}

Deleted: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java	2008-02-26 13:36:20 UTC (rev 70096)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -1,142 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, 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.aop.junit;
-
-import java.net.URL;
-
-import org.jboss.aop.microcontainer.beans.beanmetadatafactory.AOPDeployment;
-import org.jboss.dependency.spi.ControllerMode;
-import org.jboss.javabean.plugins.jaxb.JavaBean;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
-import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
-import org.jboss.kernel.spi.deployment.KernelDeployment;
-import org.jboss.logging.Logger;
-import org.jboss.test.xb.builder.JBossXBTestDelegate;
-import org.jboss.test.xb.builder.TestSchemaResolver;
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
-import org.jboss.xb.builder.JBossXBBuilder;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class JAXBDeployer extends BasicXMLDeployer
-{
-   /** The log */
-   private static final Logger log = Logger.getLogger(BasicXMLDeployer.class);
-   
-   JBossXBTestDelegate jbossXbTestDelegate;
-
-   public JAXBDeployer(Kernel kernel, ControllerMode mode, Class<?> clazz)
-   {
-      super(kernel, mode);
-      setupJaxbDelegate(clazz);
-   }
-
-   public JAXBDeployer(Kernel kernel, Class<?> clazz)
-   {
-      super(kernel);
-      setupJaxbDelegate(clazz);
-   }
-
-   private void setupJaxbDelegate(Class<?> clazz)
-   {
-      try
-      {
-         jbossXbTestDelegate = new JBossXBTestDelegate(clazz);
-         jbossXbTestDelegate.setUp();
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-   
-   public KernelDeployment unmarshal(final URL url) throws Exception
-   {
-      TestSchemaResolver resolver = setupResolver();
-      
-      KernelDeployment deployment = (KernelDeployment)jbossXbTestDelegate.unmarshal(url.toString(), resolver);
-      
-      deployment.setName(url.toString());
-
-      return deployment;
-   }
-   
-   private TestSchemaResolver setupResolver()
-   {
-      TestSchemaResolver resolver = new TestSchemaResolver();
-      
-      addSchemaBinding(resolver, AbstractKernelDeployment.class);
-      addSchemaBinding(resolver, AOPDeployment.class);
-      addSchemaBinding(resolver, JavaBean.class);
-      
-      return resolver;
-   }
-
-   private SchemaBinding addSchemaBinding(TestSchemaResolver resolver, Class<?> clazz)
-   {
-      SchemaBinding binding = JBossXBBuilder.build(clazz);
-      resolver.addSchemaBinding(binding);
-      return binding;
-   }
-   /**
-    * Deploy a url
-    * 
-    * @param url the url to deploy
-    * @return the kernel deployment
-    * @throws Throwable for any error
-    */
-   public KernelDeployment deploy(final URL url) throws Throwable
-   {
-      final boolean trace = log.isTraceEnabled();
-
-      if (url == null)
-         throw new IllegalArgumentException("Null url");
-
-      if (trace)
-         log.trace("Parsing " + url);
-
-      long start = System.currentTimeMillis();
-
-      KernelDeployment deployment = unmarshal(url);
-      
-      if (trace)
-      {
-         long now = System.currentTimeMillis();
-         log.trace("Parsing " + url + " took " + (now-start) + " milliseconds");
-      }
-
-      deploy(deployment);
-
-      if (trace)
-      {
-         long now = System.currentTimeMillis();
-         log.trace("Deploying " + url + " took " + (now-start) + " milliseconds");
-      }
-
-      return deployment;
-   }
-
-}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBDeployer.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBDeployer.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBDeployer.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -0,0 +1,142 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, 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.aop.junit;
+
+import java.net.URL;
+
+import org.jboss.aop.microcontainer.beans.beanmetadatafactory.AOPDeployment;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.javabean.plugins.jaxb.JavaBean;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.logging.Logger;
+import org.jboss.test.xb.builder.JBossXBTestDelegate;
+import org.jboss.test.xb.builder.TestSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBossXBDeployer extends BasicXMLDeployer
+{
+   /** The log */
+   private static final Logger log = Logger.getLogger(BasicXMLDeployer.class);
+   
+   JBossXBTestDelegate jbossXbTestDelegate;
+
+   public JBossXBDeployer(Kernel kernel, ControllerMode mode, Class<?> clazz)
+   {
+      super(kernel, mode);
+      setupJaxbDelegate(clazz);
+   }
+
+   public JBossXBDeployer(Kernel kernel, Class<?> clazz)
+   {
+      super(kernel);
+      setupJaxbDelegate(clazz);
+   }
+
+   private void setupJaxbDelegate(Class<?> clazz)
+   {
+      try
+      {
+         jbossXbTestDelegate = new JBossXBTestDelegate(clazz);
+         jbossXbTestDelegate.setUp();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   public KernelDeployment unmarshal(final URL url) throws Exception
+   {
+      TestSchemaResolver resolver = setupResolver();
+      
+      KernelDeployment deployment = (KernelDeployment)jbossXbTestDelegate.unmarshal(url.toString(), resolver);
+      
+      deployment.setName(url.toString());
+
+      return deployment;
+   }
+   
+   private TestSchemaResolver setupResolver()
+   {
+      TestSchemaResolver resolver = new TestSchemaResolver();
+      
+      addSchemaBinding(resolver, AbstractKernelDeployment.class);
+      addSchemaBinding(resolver, AOPDeployment.class);
+      addSchemaBinding(resolver, JavaBean.class);
+      
+      return resolver;
+   }
+
+   private SchemaBinding addSchemaBinding(TestSchemaResolver resolver, Class<?> clazz)
+   {
+      SchemaBinding binding = JBossXBBuilder.build(clazz);
+      resolver.addSchemaBinding(binding);
+      return binding;
+   }
+   /**
+    * Deploy a url
+    * 
+    * @param url the url to deploy
+    * @return the kernel deployment
+    * @throws Throwable for any error
+    */
+   public KernelDeployment deploy(final URL url) throws Throwable
+   {
+      final boolean trace = log.isTraceEnabled();
+
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      if (trace)
+         log.trace("Parsing " + url);
+
+      long start = System.currentTimeMillis();
+
+      KernelDeployment deployment = unmarshal(url);
+      
+      if (trace)
+      {
+         long now = System.currentTimeMillis();
+         log.trace("Parsing " + url + " took " + (now-start) + " milliseconds");
+      }
+
+      deploy(deployment);
+
+      if (trace)
+      {
+         long now = System.currentTimeMillis();
+         log.trace("Deploying " + url + " took " + (now-start) + " milliseconds");
+      }
+
+      return deployment;
+   }
+
+}

Deleted: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java	2008-02-26 13:36:20 UTC (rev 70096)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -1,72 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source.
-* Copyright 2006, 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.aop.junit;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
-import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
-
-/**
- * FIXME Temporary workaround since I cannot see the JBossXBTestDelegate 
- * from container-test project with maven
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-class JBossXBTestDelegate
-{
-   Class<?> clazz;
-   Object delegate;
-   Method unmarshal;
-   
-   JBossXBTestDelegate(Class<?> clazz)
-   {
-      this.clazz = clazz;
-   }
-   
-   void setUp()
-   {
-      try
-      {
-         Class<?> delegate = Class.forName("org.jboss.test.xb.builder.JBossXBTestDelegate");
-         Constructor<?> ctor = delegate.getDeclaredConstructor(Class.class);
-         this.delegate = ctor.newInstance(clazz);
-         
-         Method setUp = delegate.getMethod("setUp");
-         setUp.invoke(this.delegate);
-
-         Class<?> resolver = Class.forName("org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver");
-         this.unmarshal = delegate.getMethod("unmarshal", String.class, resolver); 
-      }
-      catch (Exception e)
-      {
-         // AutoGenerated
-         throw new RuntimeException(e);
-      }
-   }
-
-   public Object unmarshal(String url, SchemaBindingResolver resolver) throws Exception
-   {
-      return unmarshal.invoke(delegate, url, resolver);
-   }
-}

Modified: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java	2008-02-26 13:36:20 UTC (rev 70096)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java	2008-02-26 13:36:25 UTC (rev 70097)
@@ -41,7 +41,7 @@
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.PropertyMetaData;
 import org.jboss.kernel.spi.deployment.KernelDeployment;
-import org.jboss.test.aop.junit.ForceJAXBAOPMicrocontainerTest;
+import org.jboss.test.aop.junit.ForceJBossXBAopMicrocontainerTest;
 import org.jboss.test.microcontainer.beans.TestAspect;
 import org.jboss.test.microcontainer.beans.TestAspectWithDependency;
 import org.jboss.test.microcontainer.beans.TestInterceptorWithDependency;
@@ -51,7 +51,7 @@
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public class JAXBAnnotationSanityTestCase  extends ForceJAXBAOPMicrocontainerTest
+public class JAXBAnnotationSanityTestCase  extends ForceJBossXBAopMicrocontainerTest
 {
    public static Test suite()
    {




More information about the jboss-cvs-commits mailing list