[jboss-cvs] JBossAS SVN: r77001 - in projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean: test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 13 03:52:05 EDT 2008


Author: alesj
Date: 2008-08-13 03:52:04 -0400 (Wed, 13 Aug 2008)
New Revision: 77001

Added:
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/SimpleAnnotatedAlias.java
Modified:
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/AnnotatedBeansUnitTestCase.java
Log:
Add @Aliases test to annotated beans.

Copied: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/SimpleAnnotatedAlias.java (from rev 76940, projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/SimpleAnnotatedStart.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/SimpleAnnotatedAlias.java	                        (rev 0)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/support/SimpleAnnotatedAlias.java	2008-08-13 07:52:04 UTC (rev 77001)
@@ -0,0 +1,45 @@
+/*
+* 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.deployers.vfs.deployer.bean.support;
+
+import org.jboss.beans.metadata.api.annotations.Aliases;
+import org.jboss.beans.metadata.api.annotations.FactoryMethod;
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.dependency.spi.Controller;
+import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants;
+
+/**
+ * Simple annotated start.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Aliases({"Alias"})
+public class SimpleAnnotatedAlias extends SimpleAnnotated
+{
+   @FactoryMethod
+   public static SimpleAnnotatedAlias factory(@Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) Controller controller)
+   {
+      SimpleAnnotatedAlias alias = new SimpleAnnotatedAlias();
+      alias.controller = controller;
+      return alias;
+   }
+}
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/AnnotatedBeansUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/AnnotatedBeansUnitTestCase.java	2008-08-13 07:38:07 UTC (rev 77000)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/bean/test/AnnotatedBeansUnitTestCase.java	2008-08-13 07:52:04 UTC (rev 77001)
@@ -35,10 +35,11 @@
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
 import org.jboss.test.deployers.vfs.deployer.AbstractDeployerUnitTest;
+import org.jboss.test.deployers.vfs.deployer.bean.support.SimpleAnnotated;
+import org.jboss.test.deployers.vfs.deployer.bean.support.SimpleAnnotatedAlias;
 import org.jboss.test.deployers.vfs.deployer.bean.support.SimpleAnnotatedConstructor;
 import org.jboss.test.deployers.vfs.deployer.bean.support.SimpleAnnotatedInjection;
 import org.jboss.test.deployers.vfs.deployer.bean.support.SimpleAnnotatedStart;
-import org.jboss.test.deployers.vfs.deployer.bean.support.SimpleAnnotated;
 
 /**
  * AnnotatedBeansUnitTestCase.
@@ -75,7 +76,8 @@
       BeanMetaDataFactory md1 = new AbstractBeanMetaData("Constructor", SimpleAnnotatedConstructor.class.getName());
       BeanMetaDataFactory md2 = new AbstractBeanMetaData("Injection", SimpleAnnotatedInjection.class.getName());
       BeanMetaDataFactory md3 = new AbstractBeanMetaData("Start", SimpleAnnotatedStart.class.getName());
-      deployment.setBeanFactories(Arrays.asList(md1, md2, md3));
+      BeanMetaDataFactory md4 = new AbstractBeanMetaData("SomeRandomName", SimpleAnnotatedAlias.class.getName());
+      deployment.setBeanFactories(Arrays.asList(md1, md2, md3, md4));
       MutableAttachments attachments = (MutableAttachments) context.getPredeterminedManagedObjects();
       attachments.addAttachment("KernelDeployerTest", deployment);
 
@@ -85,6 +87,7 @@
          assertSimpleAnnotated("Constructor");
          assertSimpleAnnotated("Injection");
          assertSimpleAnnotated("Start");
+         assertSimpleAnnotated("Alias");
       }
       finally
       {
@@ -94,6 +97,7 @@
       assertNull(controller.getContext("Constructor", null));
       assertNull(controller.getContext("Injection", null));
       assertNull(controller.getContext("Start", null));
+      assertNull(controller.getContext("SomeRandomName", null));
    }
 
    protected void assertSimpleAnnotated(Object name)




More information about the jboss-cvs-commits mailing list