[jboss-cvs] JBossAS SVN: r75258 - in projects/microcontainer/trunk: dependency/src/main/org/jboss/dependency/spi and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 1 08:06:58 EDT 2008


Author: alesj
Date: 2008-07-01 08:06:58 -0400 (Tue, 01 Jul 2008)
New Revision: 75258

Added:
   projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase0.xml
   projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase1.xml
   projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase0.xml
   projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase1.xml
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasAnnotationTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasAnnotationTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/AnnSimpleBeanImpl.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/ScopedAnnSimpleBeanImpl.java
Modified:
   projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractController.java
   projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/ScopedController.java
   projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerState.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/AbstractKernelDependencyTest.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java
   projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainAliasTestCase.java
Log:
[JBMICROCONT-309]; add additional duplicate alias tests.

Modified: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractController.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractController.java	2008-07-01 11:57:38 UTC (rev 75257)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/AbstractController.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -491,6 +491,12 @@
       AliasControllerContext context = new AliasControllerContext(alias, original, actions);
       preAliasInstall(context);
       install(context);
+      // is alias in error
+      Throwable error = context.getError();
+      if (error != null)
+         throw error;      
+      if (ControllerState.ERROR.equals(context.getState()))
+         throw new IllegalArgumentException("Alias " + context + " is in error.");
    }
 
    /**

Modified: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/ScopedController.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/ScopedController.java	2008-07-01 11:57:38 UTC (rev 75257)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/plugins/ScopedController.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -61,6 +61,17 @@
             context.setController(this);
             registerControllerContext(context);
          }
+         catch (Throwable t)
+         {
+            // put the context back to original
+            context.setController(underlyingController);
+            underlyingController.addControllerContext(context);
+            // rethrow
+            if (t instanceof RuntimeException)
+               throw (RuntimeException)t;
+            else
+               throw new RuntimeException(t);
+         }
          finally
          {
             unlockWrite();

Modified: projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerState.java
===================================================================
--- projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerState.java	2008-07-01 11:57:38 UTC (rev 75257)
+++ projects/microcontainer/trunk/dependency/src/main/org/jboss/dependency/spi/ControllerState.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -119,6 +119,11 @@
       buffer.append(stateString);
    }
 
+   public void toShortString(JBossStringBuilder buffer)
+   {
+      buffer.append(stateString);
+   }
+
    protected int getHashCode()
    {
       return stateString.hashCode();

Copied: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase0.xml (from rev 75212, projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/PlainAliasXMLTestCase0.xml)
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase0.xml	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="OriginalBean" class="org.jboss.test.kernel.dependency.support.SimpleBeanImpl">
+      <alias>alias</alias>
+   </bean>
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase1.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase1.xml	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="DuplicateBean" class="org.jboss.test.kernel.dependency.support.SimpleBeanImpl">
+      <alias>alias</alias>
+   </bean>
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase0.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase0.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase0.xml	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="OriginalBean" class="org.jboss.test.kernel.dependency.support.SimpleBeanImpl">
+      <alias>alias</alias>
+   </bean>
+</deployment>

Added: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase1.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase1.xml	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase1.xml	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bean name="DuplicateBean" class="org.jboss.test.kernel.dependency.support.SimpleBeanImpl">
+      <alias>alias</alias>
+   </bean>
+</deployment>

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/AbstractKernelDependencyTest.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/AbstractKernelDependencyTest.java	2008-07-01 11:57:38 UTC (rev 75257)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/AbstractKernelDependencyTest.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -106,9 +106,7 @@
    
    protected ControllerContext assertInstall(int number, String name) throws Throwable
    {
-      ControllerContext result = assertInstall(number, name, ControllerState.INSTALLED);
-      assertContext(name);
-      return result;
+      return assertInstall(number, name, ControllerState.INSTALLED);
    }
 
    protected ControllerContext assertInstall(int number, String name, ControllerState expected) throws Throwable

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java	2008-07-01 11:57:38 UTC (rev 75257)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -110,7 +110,13 @@
       suite.addTest(MatcherDemandSupplyAnnotationTestCase.suite());
       suite.addTest(NestedPropertyTestCase.suite());
       suite.addTest(NestedPropertyXMLTestCase.suite());
-      suite.addTest(BeanValidatorBridgeTestCase.suite());      
+      suite.addTest(BeanValidatorBridgeTestCase.suite());
+      suite.addTest(DuplicateAliasTestCase.suite());
+      suite.addTest(DuplicateAliasXMLTestCase.suite());
+      suite.addTest(DuplicateAliasAnnotationTestCase.suite());
+      suite.addTest(ScopedDuplicateAliasTestCase.suite());
+      suite.addTest(ScopedDuplicateAliasXMLTestCase.suite());
+      suite.addTest(ScopedDuplicateAliasAnnotationTestCase.suite());
       return suite;
    }
 }

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasAnnotationTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasAnnotationTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.test.kernel.deployment.support.AnnSimpleBeanImpl;
+
+/**
+ * Duplicate alias tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DuplicateAliasAnnotationTestCase extends DuplicateAliasTestCase
+{
+   public DuplicateAliasAnnotationTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(DuplicateAliasAnnotationTestCase.class);
+   }
+
+   protected void buildMetaData() throws Throwable
+   {
+      BeanMetaData bmd1 = new AbstractBeanMetaData("OriginalBean", AnnSimpleBeanImpl.class.getName());
+      BeanMetaData bmd2 = new AbstractBeanMetaData("DuplicateBean", AnnSimpleBeanImpl.class.getName());
+      setBeanMetaDatas(new BeanMetaData[]{bmd1, bmd2});
+   }
+}
\ No newline at end of file

Copied: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasTestCase.java (from rev 75223, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainAliasTestCase.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,93 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.dependency.test;
+
+import java.util.Collections;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.test.kernel.deployment.support.SimpleBeanImpl;
+
+/**
+ * Duplicate alias tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DuplicateAliasTestCase extends AbstractKernelDependencyTest
+{
+   public DuplicateAliasTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   protected DuplicateAliasTestCase(String name, boolean xmltest) throws Throwable
+   {
+      super(name, xmltest);
+   }
+
+   public static Test suite()
+   {
+      return suite(DuplicateAliasTestCase.class);
+   }
+
+   public void testDuplicate() throws Throwable
+   {
+      buildMetaData();
+
+      assertInstall(0, "OriginalBean");
+      try
+      {
+         assertInstall(1, "DuplicateBean", ControllerState.ERROR);
+      }
+      catch (Throwable t)
+      {
+         assertInstanceOf(t, getFailureCause());
+      }
+   }
+
+   protected Class<? extends Throwable> getFailureCause()
+   {
+      return IllegalStateException.class;
+   }
+
+   protected void buildMetaData() throws Throwable
+   {
+      Object alias = "alias";
+
+      AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("OriginalBean", SimpleBeanImpl.class.getName());
+      metaData1.setAliases(Collections.singleton(alias));
+      addAnnotation(metaData1);
+
+      AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("DuplicateBean", SimpleBeanImpl.class.getName());
+      metaData2.setAliases(Collections.singleton(alias));
+      addAnnotation(metaData2);
+
+      setBeanMetaDatas(new BeanMetaData[]{metaData1, metaData2});
+   }
+
+   protected void addAnnotation(AbstractBeanMetaData bmd)
+   {
+      // noop
+   }
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.dependency.test;
+
+import junit.framework.Test;
+
+/**
+ * Duplicate alias tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DuplicateAliasXMLTestCase extends DuplicateAliasTestCase
+{
+   public DuplicateAliasXMLTestCase(String name) throws Throwable
+   {
+      super(name, true);
+   }
+
+   public static Test suite()
+   {
+      return suite(DuplicateAliasXMLTestCase.class);
+   }
+
+   protected void buildMetaData() throws Throwable
+   {
+   }
+}
\ No newline at end of file

Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainAliasTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainAliasTestCase.java	2008-07-01 11:57:38 UTC (rev 75257)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainAliasTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -41,14 +41,12 @@
  */
 public class PlainAliasTestCase extends AbstractKernelDependencyTest
 {
-   public PlainAliasTestCase(String name)
-         throws Throwable
+   public PlainAliasTestCase(String name) throws Throwable
    {
       super(name);
    }
 
-   public PlainAliasTestCase(String name, boolean xmltest)
-         throws Throwable
+   public PlainAliasTestCase(String name, boolean xmltest) throws Throwable
    {
       super(name, xmltest);
    }
@@ -64,7 +62,7 @@
       return getUtil().getContext(name);
    }
 
-   protected String  getControllerId()
+   protected String getControllerId()
    {
       Controller controller = getUtil().getKernel().getController();
       StringBuffer buffer = new StringBuffer();

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasAnnotationTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasAnnotationTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.test.kernel.deployment.support.ScopedAnnSimpleBeanImpl;
+
+/**
+ * Duplicate alias tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ScopedDuplicateAliasAnnotationTestCase extends DuplicateAliasTestCase
+{
+   public ScopedDuplicateAliasAnnotationTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(ScopedDuplicateAliasAnnotationTestCase.class);
+   }
+
+   protected void buildMetaData() throws Throwable
+   {
+      BeanMetaData bmd1 = new AbstractBeanMetaData("OriginalBean", ScopedAnnSimpleBeanImpl.class.getName());
+      BeanMetaData bmd2 = new AbstractBeanMetaData("DuplicateBean", ScopedAnnSimpleBeanImpl.class.getName());
+      setBeanMetaDatas(new BeanMetaData[]{bmd1, bmd2});
+   }
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.dependency.test;
+
+import java.util.Set;
+import java.util.HashSet;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData;
+import org.jboss.beans.metadata.spi.AnnotationMetaData;
+import org.jboss.metadata.plugins.scope.DeploymentScope;
+
+/**
+ * Duplicate alias tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ScopedDuplicateAliasTestCase extends DuplicateAliasTestCase
+{
+   public ScopedDuplicateAliasTestCase(String name) throws Throwable
+   {
+      super(name);
+   }
+
+   protected ScopedDuplicateAliasTestCase(String name, boolean xmltest) throws Throwable
+   {
+      super(name, xmltest);
+   }
+
+   public static Test suite()
+   {
+      return suite(ScopedDuplicateAliasTestCase.class);
+   }
+
+   protected void addAnnotation(AbstractBeanMetaData bmd)
+   {
+      Set<AnnotationMetaData> annotations = new HashSet<AnnotationMetaData>();
+      annotations.add(new AbstractAnnotationMetaData("@" + DeploymentScope.class.getName() + "(\"somedeployment\")"));
+      bmd.setAnnotations(annotations);
+   }
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.kernel.dependency.test;
+
+import junit.framework.Test;
+
+/**
+ * Duplicate alias tests.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ScopedDuplicateAliasXMLTestCase extends ScopedDuplicateAliasTestCase
+{
+   public ScopedDuplicateAliasXMLTestCase(String name) throws Throwable
+   {
+      super(name, true);
+   }
+
+   public static Test suite()
+   {
+      return suite(ScopedDuplicateAliasXMLTestCase.class);
+   }
+}
\ No newline at end of file

Copied: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/AnnSimpleBeanImpl.java (from rev 75212, projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/SimpleBeanImpl.java)
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/AnnSimpleBeanImpl.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/AnnSimpleBeanImpl.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,34 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt 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.kernel.deployment.support;
+
+import org.jboss.beans.metadata.api.annotations.Aliases;
+
+/**
+ * Annotated simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Aliases({"alias"})
+public class AnnSimpleBeanImpl extends SimpleBeanImpl
+{
+}
\ No newline at end of file

Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/ScopedAnnSimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/ScopedAnnSimpleBeanImpl.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/ScopedAnnSimpleBeanImpl.java	2008-07-01 12:06:58 UTC (rev 75258)
@@ -0,0 +1,36 @@
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt 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.kernel.deployment.support;
+
+import org.jboss.beans.metadata.api.annotations.Aliases;
+import org.jboss.metadata.plugins.scope.DeploymentScope;
+
+/**
+ * Annotated simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Aliases({"alias"})
+ at DeploymentScope("somedeployment")
+public class ScopedAnnSimpleBeanImpl extends SimpleBeanImpl
+{
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list