[jboss-cvs] JBossAS SVN: r101407 - in projects/kernel/trunk: dependency/src/test/java/org/jboss/test/dependency/controller/benchmark and 13 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Feb 24 11:25:26 EST 2010


Author: kabir.khan at jboss.com
Date: 2010-02-24 11:25:16 -0500 (Wed, 24 Feb 2010)
New Revision: 101407

Added:
   projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectAnnotationPlugin.java
   projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectConstructorAnnotationPlugin.java
   projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFieldAnnotationPlugin.java
   projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFilter.java
   projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectMethodAnnotationPlugin.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330InjectTestCase.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330TestSuite.java
   projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/metadata/api/annotations/Weld.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/InjectAnnotatedIgnoreInjectBean.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/NotAnnotatedIgnoreInjectBean.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAndInjectAnnotatedIgnoreInjectBean.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAnnotatedIgnoreInjectBean.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInjectedFromWeldAndMcFields.java
Removed:
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/
Modified:
   projects/kernel/trunk/
   projects/kernel/trunk/dependency/src/test/java/org/jboss/test/dependency/controller/benchmark/AbstractContextRegistryBenchmark.java
   projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
   projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/KernelTestSuite.java
   projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotated.java
   projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedMember.java
   projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedType.java
   projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/dependency/WeldControllerInitializer.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/test/AnnotatedTypeTestCase.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/First.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/Middle.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBean.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInitializerMethod.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanMcConstructor.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanWithPostConstructAndPreDestroy.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/MissingDependenciesFieldBean.java
   projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/test/InjectWeldInMcBeansTestCase.java
Log:
[JBKERNEL-103][JBKERNEL-51] Implement JSR 330 @Inject in kernel, and modify weld-int to make it possible to choose whether @Inject in an MC bean should come from MC (plain @Inject) or Weld (@Weld @Inject)


Property changes on: projects/kernel/trunk
___________________________________________________________________
Name: svnmerge-integrated
   + /projects/kernel/trunk:1-101255

Modified: projects/kernel/trunk/dependency/src/test/java/org/jboss/test/dependency/controller/benchmark/AbstractContextRegistryBenchmark.java
===================================================================
--- projects/kernel/trunk/dependency/src/test/java/org/jboss/test/dependency/controller/benchmark/AbstractContextRegistryBenchmark.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/dependency/src/test/java/org/jboss/test/dependency/controller/benchmark/AbstractContextRegistryBenchmark.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -27,7 +27,6 @@
 import org.jboss.dependency.plugins.AbstractController;
 import org.jboss.dependency.plugins.AbstractControllerContext;
 import org.jboss.dependency.plugins.tracker.AbstractContextRegistry;
-import org.jboss.dependency.plugins.tracker.AbstractContextRegistry2;
 import org.jboss.dependency.spi.ControllerContext;
 
 import junit.framework.TestCase;
@@ -47,7 +46,6 @@
    public void testContextRegistry()
    {
       AbstractContextRegistry registry = new AbstractContextRegistry(new AbstractController());
-//      AbstractContextRegistry2 registry = new AbstractContextRegistry2(new AbstractController());
       
       List<ControllerContext> contexts = createContexts();
       

Modified: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -25,6 +25,7 @@
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+
 /**
  * Basic bean annotation handler.
  *
@@ -64,6 +65,7 @@
 */
       // constructor
       addAnnotationPlugin(new ConstructorParameterAnnotationPlugin(adapters));
+      addAnnotationPlugin(new Jsr330InjectConstructorAnnotationPlugin(adapters));
       // property
       addAnnotationPlugin(InjectAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(StringValueAnnotationPlugin.INSTANCE);
@@ -78,6 +80,7 @@
       addAnnotationPlugin(MapValueAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(PropertyInstallCallbackAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(PropertyUninstallCallbackAnnotationPlugin.INSTANCE);
+      addAnnotationPlugin(Jsr330InjectAnnotationPlugin.INSTANCE);
       // method
       addAnnotationPlugin(new FactoryMethodAnnotationPlugin(adapters));
       addAnnotationPlugin(new CreateLifecycleAnnotationPlugin(adapters));
@@ -88,11 +91,13 @@
       addAnnotationPlugin(new MethodUninstallCallbackAnnotationPlugin());
       addAnnotationPlugin(new InstallMethodParameterAnnotationPlugin(adapters));
       addAnnotationPlugin(new UninstallMethodParameterAnnotationPlugin(adapters));
+      addAnnotationPlugin(new Jsr330InjectMethodAnnotationPlugin(adapters));
       // field
       addAnnotationPlugin(InjectFieldAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(ValueFactoryFieldAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(InstallFieldCallbackAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(UninstallFieldCallbackAnnotationPlugin.INSTANCE);
+      addAnnotationPlugin(new Jsr330InjectFieldAnnotationPlugin());
       
       //Qualifiers
       addMetaAnnotationPlugin(SuppliedQualifierAnnotationPlugin.INSTANCE);

Copied: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectAnnotationPlugin.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectAnnotationPlugin.java)
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectAnnotationPlugin.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectAnnotationPlugin.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,63 @@
+/*
+* 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.kernel.plugins.annotations;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * Inject value annotation plugin.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Jsr330InjectAnnotationPlugin extends PropertyAnnotationPlugin<Inject>
+{
+   public final static Jsr330InjectAnnotationPlugin INSTANCE = new Jsr330InjectAnnotationPlugin();
+   
+   protected Jsr330InjectAnnotationPlugin()
+   {
+      super(Inject.class);
+   }
+
+   @Override
+   protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(PropertyInfo info, MetaData retrieval, Inject annotation, BeanMetaData beanMetaData) throws Throwable
+   {
+       if (!Jsr330InjectFilter.INSTANCE.handleInject(retrieval))
+          return null;
+      
+       return super.internalApplyAnnotation(info, retrieval, annotation, beanMetaData);
+   }
+
+   @Override
+   public ValueMetaData createValueMetaData(Inject annotation)
+   {
+      return new AbstractInjectionValueMetaData();
+   }
+}

Copied: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectConstructorAnnotationPlugin.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectConstructorAnnotationPlugin.java)
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectConstructorAnnotationPlugin.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectConstructorAnnotationPlugin.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,131 @@
+/*
+* 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.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.ElementType;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import org.jboss.beans.metadata.api.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
+import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.beans.metadata.spi.ParameterMetaData;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.reflect.spi.ConstructorInfo;
+import org.jboss.reflect.spi.ParameterInfo;
+
+/**
+ * Constructor annotation plugin.
+ *
+ * @author <a href="mailto:kabir.khan at jboss.com">Kabir Khan</a>
+ */
+public class Jsr330InjectConstructorAnnotationPlugin extends AbstractConstructorParameterAnnotationPlugin<Inject, AbstractConstructorMetaData>
+{
+   public Jsr330InjectConstructorAnnotationPlugin(Map<Class<? extends Annotation>, Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
+   {
+      super(Inject.class, adapters);
+   }
+
+   protected boolean checkAnnotatedInfo(ElementType type)
+   {
+      return ElementType.CONSTRUCTOR == type;
+   }
+
+   protected boolean isMetaDataAlreadyPresent(ConstructorInfo info, Constructor annotation, BeanMetaData beanMetaData)
+   {
+      return beanMetaData.getConstructor() != null;
+   }
+
+   protected ParameterInfo[] getParameters(ConstructorInfo info)
+   {
+      return info.getParameters();
+   }
+
+   protected List<MetaDataVisitorNode> handleParameterlessInfo(ConstructorInfo info, Inject annotation, BeanMetaData beanMetaData)
+   {
+      // do nothing, default will be used
+      return null;
+   }
+
+   @Override
+   protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(ConstructorInfo info, MetaData retrieval, Inject annotation, KernelControllerContext context) throws Throwable
+   {
+      if (!Jsr330InjectFilter.INSTANCE.handleInject(retrieval))
+         return null;
+
+      //Add the standard MC @Inject annotation to each parameter so that the AbstractInjectionValueMetaData gets created
+      ParameterInfo[] params = info.getParameters();
+      if (params.length == 0)
+         return null;
+      
+      if (context.getBeanMetaData() instanceof AbstractBeanMetaData == false)
+         throw new IllegalStateException("Bean meta data is not AbstractBeanMetaData");
+
+      AbstractBeanMetaData beanMetaData = (AbstractBeanMetaData)context.getBeanMetaData();
+      
+      AbstractConstructorMetaData cmd = null;
+      if (beanMetaData.getConstructor() == null)
+      {
+         cmd = new AbstractConstructorMetaData();
+         beanMetaData.setConstructor(cmd);
+      }
+      else
+      {
+         if (beanMetaData.getConstructor() instanceof AbstractConstructorMetaData == false)   
+            throw new IllegalStateException("Constructor is not AbstractConstructorMetaData");
+         else
+            cmd = (AbstractConstructorMetaData)beanMetaData.getConstructor();
+      }
+         
+         
+      List<ParameterMetaData> parameters = cmd.getParameters();
+      if (parameters == null)
+      {
+         parameters = new ArrayList<ParameterMetaData>();
+         cmd.setParameters(parameters);
+      }
+
+      for (int i = 0 ; i < params.length ; i++)
+      {
+         AbstractInjectionValueMetaData inject = new AbstractInjectionValueMetaData();
+         AbstractParameterMetaData param = new AbstractParameterMetaData(params[i].getParameterType().getName(), inject);
+         parameters.add(param);
+      }
+      
+      return Collections.singletonList(cmd);
+   }
+   
+   protected void setParameterizedMetaData(AbstractConstructorMetaData parameterizedMetaData, BeanMetaData beanMetaData)
+   {
+      //Just override to satisfy the interface requirements
+   }
+}

Copied: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFieldAnnotationPlugin.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFieldAnnotationPlugin.java)
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFieldAnnotationPlugin.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFieldAnnotationPlugin.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,65 @@
+/*
+* 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.kernel.plugins.annotations;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.jboss.beans.info.spi.PropertyInfo;
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.reflect.spi.FieldInfo;
+
+/**
+ * Value factory field annotation plugin.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Jsr330InjectFieldAnnotationPlugin extends FieldAnnotationPlugin<Inject>
+{
+   public static final Jsr330InjectFieldAnnotationPlugin INSTANCE = new Jsr330InjectFieldAnnotationPlugin();
+
+   protected Jsr330InjectFieldAnnotationPlugin()
+   {
+      super(Inject.class);
+   }
+
+
+   @Override
+   protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(FieldInfo info, MetaData retrieval, Inject annotation, BeanMetaData beanMetaData) throws Throwable
+   {
+       if (!Jsr330InjectFilter.INSTANCE.handleInject(retrieval))
+          return null;
+      
+       return super.internalApplyAnnotation(info, retrieval, annotation, beanMetaData);
+   }
+
+   @Override
+   public ValueMetaData createValueMetaData(Inject annotation)
+   {
+      return new AbstractInjectionValueMetaData();
+   }
+}

Copied: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFilter.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFilter.java)
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFilter.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectFilter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,73 @@
+/*
+* 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.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.inject.Inject;
+
+import org.jboss.metadata.spi.MetaData;
+
+/**
+ * Singleton Used to filter out which {@link Inject} annotated injection points should not be handled.
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Jsr330InjectFilter
+{
+   public static Jsr330InjectFilter INSTANCE = new Jsr330InjectFilter();
+   
+   Set<Class<? extends Annotation>> ignoredClasses = new HashSet<Class<? extends Annotation>>();
+   
+   private Jsr330InjectFilter()
+   {
+   }
+   
+   /**
+    * Add an annotation. If this annotation is present on the injection point we should not handle this inject.
+    * 
+    * @param annotation an ignored annotation to add
+    */
+   public void addIgnoredAnnotation(Class<? extends Annotation> annotation)
+   {
+      ignoredClasses.add(annotation);
+   }
+   
+   /**
+    * Check if kernel should handle the injection
+    * 
+    * @param retrieval The metadata for the injection point we are checking
+    * @return true if this injection point should be handled by kernel
+    */
+   public boolean handleInject(MetaData retrieval)
+   {
+      for (Annotation ann : retrieval.getAnnotations())
+      {
+         if (ignoredClasses.contains(ann.annotationType()))
+            return false;
+      }
+      return true;
+   }
+}

Copied: projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectMethodAnnotationPlugin.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectMethodAnnotationPlugin.java)
===================================================================
--- projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectMethodAnnotationPlugin.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Jsr330InjectMethodAnnotationPlugin.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,113 @@
+/*
+* 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.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
+import org.jboss.beans.metadata.plugins.AbstractInstallMetaData;
+import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.InstallMetaData;
+import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
+import org.jboss.beans.metadata.spi.ParameterMetaData;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.reflect.spi.MethodInfo;
+import org.jboss.reflect.spi.ParameterInfo;
+
+/**
+ * Install method annotation plugin.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class Jsr330InjectMethodAnnotationPlugin extends InstallationParameterAnnotationPlugin<Inject>
+{
+   public Jsr330InjectMethodAnnotationPlugin(Map<Class<? extends Annotation>, Annotation2ValueMetaDataAdapter<? extends Annotation>> adapters)
+   {
+      super(Inject.class, adapters);
+   }
+
+   protected List<InstallMetaData> getInstalls(BeanMetaData beanMetaData)
+   {
+      return beanMetaData.getInstalls();
+   }
+
+   @Override
+   protected List<? extends MetaDataVisitorNode> internalApplyAnnotation(MethodInfo info, MetaData retrieval, Inject annotation, KernelControllerContext context) throws Throwable
+   {
+      if (!Jsr330InjectFilter.INSTANCE.handleInject(retrieval))
+         return null;
+
+      //Add the standard MC @Inject annotation to each parameter so that the AbstractInjectionValueMetaData gets created
+      ParameterInfo[] params = info.getParameters();
+      if (params.length == 0)
+         return null;
+      
+      if (context.getBeanMetaData() instanceof AbstractBeanMetaData == false)
+         throw new IllegalStateException("Bean meta data is not AbstractBeanMetaData");
+
+      AbstractBeanMetaData beanMetaData = (AbstractBeanMetaData)context.getBeanMetaData();
+      
+      List<InstallMetaData> installs = beanMetaData.getInstalls();
+      if (installs == null)
+      {
+         installs = new ArrayList<InstallMetaData>();
+         beanMetaData.setInstalls(installs);
+      }
+      AbstractInstallMetaData install = new AbstractInstallMetaData();
+      install.setMethodName(info.getName());
+      install.setState(ControllerState.CONFIGURED);
+      install.setDependentState(ControllerState.INSTALLED);
+      installs.add(install);
+
+         
+      List<ParameterMetaData> parameters = install.getParameters();
+      if (parameters == null)
+      {
+         parameters = new ArrayList<ParameterMetaData>();
+         install.setParameters(parameters);
+      }
+
+      for (int i = 0 ; i < params.length ; i++)
+      {
+         AbstractInjectionValueMetaData inject = new AbstractInjectionValueMetaData();
+         AbstractParameterMetaData param = new AbstractParameterMetaData(params[i].getParameterType().getName(), inject);
+         parameters.add(param);
+      }
+      
+      return Collections.singletonList(install);
+   }
+
+   protected void setParameterizedMetaData(AbstractInstallMetaData parameterizedMetaData, BeanMetaData beanMetaData)
+   {
+      //Just override to satisfy the interface requirements
+   }
+}

Modified: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/KernelTestSuite.java
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/KernelTestSuite.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/KernelTestSuite.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -35,6 +35,7 @@
 import org.jboss.test.kernel.deployment.xml.test.XMLTestSuite;
 import org.jboss.test.kernel.event.test.EventTestSuite;
 import org.jboss.test.kernel.inject.test.ContextualInjectionTestSuite;
+import org.jboss.test.kernel.jsr330.test.Jsr330TestSuite;
 import org.jboss.test.kernel.lazy.test.LazyTestSuite;
 import org.jboss.test.kernel.metadata.test.MetaDataTestSuite;
 import org.jboss.test.kernel.registry.test.RegistryTestSuite;
@@ -69,6 +70,7 @@
       suite.addTest(AnnotationsTestSuite.suite());
       suite.addTest(LazyTestSuite.suite());
       suite.addTest(PropsTestSuite.suite());
+      suite.addTest(Jsr330TestSuite.suite());
 
       return suite;
    }

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330 (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330)

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support)

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,32 +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.kernel.jsr330.support;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class Bean
-{
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/Bean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,32 @@
+/*
+* 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.kernel.jsr330.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Bean
+{
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,33 +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.kernel.jsr330.support;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at QualifierA
-public class BeanA extends Bean
-{
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanA.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,33 @@
+/*
+* 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.kernel.jsr330.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at QualifierA
+public class BeanA extends Bean
+{
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,33 +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.kernel.jsr330.support;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at QualifierB
-public class BeanB extends Bean
-{
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanB.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,33 @@
+/*
+* 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.kernel.jsr330.support;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at QualifierB
+public class BeanB extends Bean
+{
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,51 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableConstructorAndParameter
-{
-   Bean bean;
-   
-   public BeanWithInjectableConstructorAndParameter()
-   {
-   }
-   
-   @Inject
-   public BeanWithInjectableConstructorAndParameter(Bean bean)
-   {
-      this.bean = bean;
-   }
-   
-
-   public Bean getBean()
-   {
-      return bean;
-   }
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,51 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableConstructorAndParameter
+{
+   Bean bean;
+   
+   public BeanWithInjectableConstructorAndParameter()
+   {
+   }
+   
+   @Inject
+   public BeanWithInjectableConstructorAndParameter(Bean bean)
+   {
+      this.bean = bean;
+   }
+   
+
+   public Bean getBean()
+   {
+      return bean;
+   }
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,51 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableConstructorAndQualifiedParameter
-{
-   Bean bean;
-   
-   public BeanWithInjectableConstructorAndQualifiedParameter()
-   {
-   }
-   
-   @Inject
-   public BeanWithInjectableConstructorAndQualifiedParameter(@QualifierA Bean bean)
-   {
-      this.bean = bean;
-   }
-   
-
-   public Bean getBean()
-   {
-      return bean;
-   }
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorAndQualifiedParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,51 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableConstructorAndQualifiedParameter
+{
+   Bean bean;
+   
+   public BeanWithInjectableConstructorAndQualifiedParameter()
+   {
+   }
+   
+   @Inject
+   public BeanWithInjectableConstructorAndQualifiedParameter(@QualifierA Bean bean)
+   {
+      this.bean = bean;
+   }
+   
+
+   public Bean getBean()
+   {
+      return bean;
+   }
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,43 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableConstructorNoParameters
-{
-   @Inject
-   public BeanWithInjectableConstructorNoParameters()
-   {
-      
-   }
-   
-   public BeanWithInjectableConstructorNoParameters(Bean bean)
-   {
-      
-   }
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableConstructorNoParameters.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,43 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableConstructorNoParameters
+{
+   @Inject
+   public BeanWithInjectableConstructorNoParameters()
+   {
+      
+   }
+   
+   public BeanWithInjectableConstructorNoParameters(Bean bean)
+   {
+      
+   }
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,35 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableField
-{
-   @Inject 
-   public Bean bean;
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableField.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,35 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableField
+{
+   @Inject 
+   public Bean bean;
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,45 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableMethod
-{
-   Bean bean;
-   
-   public Bean getBean()
-   {
-      return bean;
-   }
-   
-   @Inject
-   public void install(Bean bean)
-   {
-      this.bean = bean;
-   }
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethod.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,45 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableMethod
+{
+   Bean bean;
+   
+   public Bean getBean()
+   {
+      return bean;
+   }
+   
+   @Inject
+   public void install(Bean bean)
+   {
+      this.bean = bean;
+   }
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,45 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableMethodAndQualifiedParameter
-{
-   Bean bean;
-   
-   public Bean getBean()
-   {
-      return bean;
-   }
-   
-   @Inject
-   public void install(@QualifierA Bean bean)
-   {
-      this.bean = bean;
-   }
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableMethodAndQualifiedParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,45 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableMethodAndQualifiedParameter
+{
+   Bean bean;
+   
+   public Bean getBean()
+   {
+      return bean;
+   }
+   
+   @Inject
+   public void install(@QualifierA Bean bean)
+   {
+      this.bean = bean;
+   }
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,47 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableProperty
-{
-   private Bean bean;
-
-   public Bean getBean()
-   {
-      return bean;
-   }
-
-   @Inject
-   public void setBean(Bean bean)
-   {
-      this.bean = bean;
-   }
-   
-   
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableProperty.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,47 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableProperty
+{
+   private Bean bean;
+
+   public Bean getBean()
+   {
+      return bean;
+   }
+
+   @Inject
+   public void setBean(Bean bean)
+   {
+      this.bean = bean;
+   }
+   
+   
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,47 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectablePropertyQualifiedOnParameter
-{
-   private Bean bean;
-
-   public Bean getBean()
-   {
-      return bean;
-   }
-
-   @Inject
-   public void setBean(@QualifierA Bean bean)
-   {
-      this.bean = bean;
-   }
-   
-   
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnParameter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,47 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectablePropertyQualifiedOnParameter
+{
+   private Bean bean;
+
+   public Bean getBean()
+   {
+      return bean;
+   }
+
+   @Inject
+   public void setBean(@QualifierA Bean bean)
+   {
+      this.bean = bean;
+   }
+   
+   
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,48 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectablePropertyQualifiedOnSetter
-{
-   private Bean bean;
-
-   public Bean getBean()
-   {
-      return bean;
-   }
-
-   @Inject
-   @QualifierA
-   public void setBean(Bean bean)
-   {
-      this.bean = bean;
-   }
-   
-   
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectablePropertyQualifiedOnSetter.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,48 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectablePropertyQualifiedOnSetter
+{
+   private Bean bean;
+
+   public Bean getBean()
+   {
+      return bean;
+   }
+
+   @Inject
+   @QualifierA
+   public void setBean(Bean bean)
+   {
+      this.bean = bean;
+   }
+   
+   
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,34 +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.kernel.jsr330.support;
-
-import javax.inject.Inject;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
-public class BeanWithInjectableQualifiedField
-{
-   @Inject @QualifierB public Bean bean;
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/BeanWithInjectableQualifiedField.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,34 @@
+/*
+* 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.kernel.jsr330.support;
+
+import javax.inject.Inject;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeanWithInjectableQualifiedField
+{
+   @Inject @QualifierB public Bean bean;
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,37 +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.kernel.jsr330.support;
-
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at java.lang.annotation.Documented
- at java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
- at javax.inject.Qualifier
-public @interface QualifierA
-{
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierA.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,37 @@
+/*
+* 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.kernel.jsr330.support;
+
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at java.lang.annotation.Documented
+ at java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
+ at javax.inject.Qualifier
+public @interface QualifierA
+{
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,37 +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.kernel.jsr330.support;
-
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at java.lang.annotation.Documented
- at java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
- at javax.inject.Qualifier
-public @interface QualifierB
-{
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/QualifierB.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,37 @@
+/*
+* 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.kernel.jsr330.support;
+
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at java.lang.annotation.Documented
+ at java.lang.annotation.Retention(RetentionPolicy.RUNTIME)
+ at javax.inject.Qualifier
+public @interface QualifierB
+{
+
+}

Deleted: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java
===================================================================
--- projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -1,35 +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.kernel.jsr330.support;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-/**
- * 
- * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
- * @version $Revision: 1.1 $
- */
- at Retention(RetentionPolicy.RUNTIME)
-public @interface SomeAnnotation {
-
-}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java)
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/support/SomeAnnotation.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,35 @@
+/*
+* 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.kernel.jsr330.support;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface SomeAnnotation {
+
+}

Copied: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test (from rev 101406, projects/kernel/branches/jsr330/kernel/src/test/java/org/jboss/test/kernel/jsr330/test)

Added: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330InjectTestCase.java
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330InjectTestCase.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330InjectTestCase.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,352 @@
+/*
+* 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.kernel.jsr330.test;
+
+import junit.framework.Test;
+
+import org.jboss.beans.info.spi.BeanAccessMode;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.test.kernel.jsr330.support.Bean;
+import org.jboss.test.kernel.jsr330.support.BeanA;
+import org.jboss.test.kernel.jsr330.support.BeanB;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableConstructorAndParameter;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableConstructorAndQualifiedParameter;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableConstructorNoParameters;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableField;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableMethod;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableMethodAndQualifiedParameter;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableProperty;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectablePropertyQualifiedOnParameter;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectablePropertyQualifiedOnSetter;
+import org.jboss.test.kernel.jsr330.support.BeanWithInjectableQualifiedField;
+import org.jboss.test.kernel.jsr330.support.SomeAnnotation;
+import org.jboss.test.kernel.junit.MicrocontainerTest;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class Jsr330InjectTestCase extends MicrocontainerTest
+{
+   public Jsr330InjectTestCase(String name)
+   {
+      super(name);
+   }
+
+   public static Test suite()
+   {
+      return suite(Jsr330InjectTestCase.class);
+   }
+
+   public void testInjectableConstructorNoParameters() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableConstructorNoParameters.class.getName());
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         assertBean("bean1", Bean.class);
+         assertBean("bean2", BeanWithInjectableConstructorNoParameters.class);
+         
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableConstructorAndParameterNoInstanceMetaData() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableConstructorAndParameter.class.getName());
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("bean1", Bean.class);
+         BeanWithInjectableConstructorAndParameter tgt = assertBean("bean2", BeanWithInjectableConstructorAndParameter.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableConstructorAndParameterWithInstanceMetaData() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableConstructorAndParameter.class.getName());
+      bean2Builder.addAnnotation("@" + SomeAnnotation.class.getName());
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("bean1", Bean.class);
+         BeanWithInjectableConstructorAndParameter tgt = assertBean("bean2", BeanWithInjectableConstructorAndParameter.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableConstructorAndQualifierParameter() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanABuilder = BeanMetaDataBuilder.createBuilder("beanA", BeanA.class.getName());
+      KernelControllerContext beanAContext = deploy(beanABuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanBBuilder = BeanMetaDataBuilder.createBuilder("beanB", BeanB.class.getName());
+      KernelControllerContext beanBContext = deploy(beanBBuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableConstructorAndQualifiedParameter.class.getName());
+      bean2Builder.addAnnotation("@" + SomeAnnotation.class.getName());
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         assertNotSame(assertBean("bean1", Bean.class), assertBean("beanA", Bean.class));
+         assertNotSame(assertBean("beanA", Bean.class), assertBean("beanB", Bean.class));
+
+         BeanWithInjectableConstructorAndQualifiedParameter tgt = assertBean("bean2", BeanWithInjectableConstructorAndQualifiedParameter.class);
+         assertNotNull(tgt.getBean());
+         assertSame(assertBean("beanA", Bean.class), tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(beanAContext);
+         undeploy(beanBContext);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableField() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableField.class.getName());
+      bean2Builder.setAccessMode(BeanAccessMode.FIELDS);
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("bean1", Bean.class);
+         BeanWithInjectableField tgt = assertBean("bean2", BeanWithInjectableField.class);
+         assertNotNull(tgt.bean);
+         assertSame(bean, tgt.bean);
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableQualifiedField() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanABuilder = BeanMetaDataBuilder.createBuilder("beanA", BeanA.class.getName());
+      KernelControllerContext beanAContext = deploy(beanABuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanBBuilder = BeanMetaDataBuilder.createBuilder("beanB", BeanB.class.getName());
+      KernelControllerContext beanBContext = deploy(beanBBuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableQualifiedField.class.getName());
+      bean2Builder.setAccessMode(BeanAccessMode.FIELDS);
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("beanB", Bean.class);
+         BeanWithInjectableQualifiedField tgt = assertBean("bean2", BeanWithInjectableQualifiedField.class);
+         assertNotNull(tgt.bean);
+         assertSame(bean, tgt.bean);
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(beanAContext);
+         undeploy(beanBContext);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableProperty() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableProperty.class.getName());
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("bean1", Bean.class);
+         BeanWithInjectableProperty tgt = assertBean("bean2", BeanWithInjectableProperty.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectablePropertyQualifiedOnParameter() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanABuilder = BeanMetaDataBuilder.createBuilder("beanA", BeanA.class.getName());
+      KernelControllerContext beanAContext = deploy(beanABuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanBBuilder = BeanMetaDataBuilder.createBuilder("beanB", BeanB.class.getName());
+      KernelControllerContext beanBContext = deploy(beanBBuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectablePropertyQualifiedOnParameter.class.getName());
+      bean2Builder.setAccessMode(BeanAccessMode.FIELDS);
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("beanA", Bean.class);
+         BeanWithInjectablePropertyQualifiedOnParameter tgt = assertBean("bean2", BeanWithInjectablePropertyQualifiedOnParameter.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(beanAContext);
+         undeploy(beanBContext);
+         undeploy(bean2Context);
+      }
+   }
+   
+   
+   public void testInjectablePropertyQualifiedOnSetter() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanABuilder = BeanMetaDataBuilder.createBuilder("beanA", BeanA.class.getName());
+      KernelControllerContext beanAContext = deploy(beanABuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanBBuilder = BeanMetaDataBuilder.createBuilder("beanB", BeanB.class.getName());
+      KernelControllerContext beanBContext = deploy(beanBBuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectablePropertyQualifiedOnSetter.class.getName());
+      bean2Builder.setAccessMode(BeanAccessMode.FIELDS);
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("beanA", Bean.class);
+         BeanWithInjectablePropertyQualifiedOnSetter tgt = assertBean("bean2", BeanWithInjectablePropertyQualifiedOnSetter.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(beanAContext);
+         undeploy(beanBContext);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableMethod() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableMethod.class.getName());
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("bean1", Bean.class);
+         BeanWithInjectableMethod tgt = assertBean("bean2", BeanWithInjectableMethod.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(bean2Context);
+      }
+   }
+   
+   public void testInjectableMethodWithQualifiers() throws Throwable
+   {
+      BeanMetaDataBuilder bean1Builder = BeanMetaDataBuilder.createBuilder("bean1", Bean.class.getName());
+      KernelControllerContext bean1Context = deploy(bean1Builder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanABuilder = BeanMetaDataBuilder.createBuilder("beanA", BeanA.class.getName());
+      KernelControllerContext beanAContext = deploy(beanABuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder beanBBuilder = BeanMetaDataBuilder.createBuilder("beanB", BeanB.class.getName());
+      KernelControllerContext beanBContext = deploy(beanBBuilder.getBeanMetaData());
+
+      BeanMetaDataBuilder bean2Builder = BeanMetaDataBuilder.createBuilder("bean2", BeanWithInjectableMethodAndQualifiedParameter.class.getName());
+      bean2Builder.setAccessMode(BeanAccessMode.FIELDS);
+      KernelControllerContext bean2Context = deploy(bean2Builder.getBeanMetaData());
+
+      try
+      {
+         Bean bean = assertBean("beanA", Bean.class);
+         BeanWithInjectableMethodAndQualifiedParameter tgt = assertBean("bean2", BeanWithInjectableMethodAndQualifiedParameter.class);
+         assertNotNull(tgt.getBean());
+         assertSame(bean, tgt.getBean());
+      }
+      finally
+      {
+         undeploy(bean1Context);
+         undeploy(beanAContext);
+         undeploy(beanBContext);
+         undeploy(bean2Context);
+      }
+   }
+}

Added: projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330TestSuite.java
===================================================================
--- projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330TestSuite.java	                        (rev 0)
+++ projects/kernel/trunk/kernel/src/test/java/org/jboss/test/kernel/jsr330/test/Jsr330TestSuite.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,48 @@
+/*
+* 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.jsr330.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+
+/**
+ * Contextual injection Test Suite.
+ *
+ * @author <a href="mailto:ales.justin at gmail.com">Ales Justin</a>
+ */
+public class Jsr330TestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(Jsr330TestSuite.suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("JSR 330 Tests");
+
+      suite.addTest(Jsr330InjectTestCase.suite());
+
+      return suite;
+   }
+}

Copied: projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/metadata/api/annotations/Weld.java (from rev 101406, projects/kernel/branches/jsr330/weld-int/src/main/java/org/jboss/kernel/weld/metadata/api/annotations/Weld.java)
===================================================================
--- projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/metadata/api/annotations/Weld.java	                        (rev 0)
+++ projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/metadata/api/annotations/Weld.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,51 @@
+/*
+* 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.kernel.weld.metadata.api.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Inject;
+
+/**
+ * MC supports JSR 330 annotations (i.e. {@link Inject}). Use this
+ * annotation to select if a particular injected value should come from Weld.
+ * 
+ * <pre>
+ * public class Bean{
+ *    &#64;Inject Thing t;
+ *    &#64;Weld &#64;Inject Other o;
+ * }
+ * </pre>
+ * 
+ * Here the MC kernel will try to inject <code>t</code> from the MC, and <code>o</code> from Weld.
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD})
+public @interface Weld {
+
+}

Modified: projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotated.java
===================================================================
--- projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotated.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotated.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -29,7 +29,9 @@
 import java.util.Set;
 
 import javax.enterprise.inject.spi.Annotated;
+import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 import org.jboss.metadata.spi.MetaData;
 
 /**
@@ -126,11 +128,11 @@
    {
       Set<Annotation> annotations = new HashSet<Annotation>(getDelegate().getAnnotations());
       if (metaData == null)
-         return annotations;
+         return trimInjectIfWeldAbsent(annotations);
 
       Annotation[] metaDataAnnotations = metaData.getAnnotations();
       if (metaDataAnnotations.length == 0)
-         return annotations;
+         return trimInjectIfWeldAbsent(annotations);
       
       if (annotations.size() == 0)
       {
@@ -139,7 +141,7 @@
          {
             metaDataAnns.add(ann);
          }
-         return metaDataAnns;
+         return trimInjectIfWeldAbsent(metaDataAnns);
       }
       
       Map<Class<?>, Annotation> done = new HashMap<Class<?>, Annotation>();
@@ -150,7 +152,7 @@
       {
          done.put(annotation.annotationType(), annotation);
       }
-      return new HashSet<Annotation>(done.values());
+      return trimInjectIfWeldAbsent(new HashSet<Annotation>(done.values()));
    }
 
    /**
@@ -167,4 +169,10 @@
       }
       return getDelegate().isAnnotationPresent(annotationType);
    }
+   
+   protected Set<Annotation> trimInjectIfWeldAbsent(Set<Annotation> annotations)
+   {
+      //Empty, only implement for members
+      return annotations;
+   }
 }

Modified: projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedMember.java
===================================================================
--- projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedMember.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedMember.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -21,10 +21,15 @@
 */ 
 package org.jboss.kernel.weld.plugins.annotated;
 
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
 import javax.enterprise.inject.spi.Annotated;
 import javax.enterprise.inject.spi.AnnotatedMember;
 import javax.enterprise.inject.spi.AnnotatedType;
+import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 import org.jboss.metadata.spi.MetaData;
 
 /**
@@ -96,4 +101,33 @@
       return getDelegate().isStatic();
    }
 
+   protected Set<Annotation> trimInjectIfWeldAbsent(Set<Annotation> annotations)
+   {
+      if (!super.isAnnotationPresent(Weld.class) && super.isAnnotationPresent(Inject.class))
+      {
+         for (Annotation ann : annotations)
+         {
+            if (ann.annotationType() == Inject.class)
+               annotations.remove(ann);
+         }
+      }
+      return annotations;
+   }
+
+   public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+   {
+      if (annotationType.equals(Inject.class) && !super.isAnnotationPresent(Weld.class))
+         return false;
+
+      return super.isAnnotationPresent(annotationType);
+   }
+   
+   public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+   {
+      if (annotationType.equals(Inject.class) && !isAnnotationPresent(Weld.class))
+         return null;
+      
+      return super.getAnnotation(annotationType);
+   }
+
 }

Modified: projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedType.java
===================================================================
--- projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedType.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/annotated/MDRAnnotatedType.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -66,57 +66,48 @@
    }
    
    /**
-    * Decorates the fields if MDR metadata is present
+    * Decorates the fields
     * 
     * @return the fields 
     */
    private Set<AnnotatedField<? super X>> initialiseAnnotatedFields()
    {
-      if (getMetaData() == null)
-         return getDelegate().getFields();
-
       Set<AnnotatedField<? super X>> fields = new HashSet<AnnotatedField<? super X>>();
       for (AnnotatedField<? super X> field : getDelegate().getFields())
       {
-         MetaData fieldMetaData = getMetaData().getComponentMetaData(new FieldSignature(field.getJavaMember()));
+         MetaData fieldMetaData = getMetaData() == null ? null : getMetaData().getComponentMetaData(new FieldSignature(field.getJavaMember()));
          fields.add(new MDRAnnotatedField<X>(this, field, fieldMetaData));
       }
       return fields;
    }
    
    /**
-    * Decorates the constructors if MDR metadata is present
+    * Decorates the constructors
     * 
     * @return the constructors
     */
    private Set<AnnotatedConstructor<X>> initialiseConstructors()
    {
-      if (getMetaData() == null)
-         return getDelegate().getConstructors();
-
       Set<AnnotatedConstructor<X>> constructors = new HashSet<AnnotatedConstructor<X>>();
       for (AnnotatedConstructor<X> constructor : getDelegate().getConstructors())
       {
-         MetaData constructorMetaData = getMetaData().getComponentMetaData(new ConstructorSignature(constructor.getJavaMember()));
+         MetaData constructorMetaData = getMetaData() == null ? null : getMetaData().getComponentMetaData(new ConstructorSignature(constructor.getJavaMember()));
          constructors.add(new MDRAnnotatedConstructor<X>(this, constructor, constructorMetaData, getMetaData()));
       }
       return constructors;
    }
    
    /**
-    * Decorates the methods if MDR metadata is present
+    * Decorates the methods
     * 
     * @return the methods
     */
    private Set<AnnotatedMethod<? super X>> initialiseMethods()
    {
-      if (getMetaData() == null)
-         return getDelegate().getMethods();
-
       Set<AnnotatedMethod<? super X>> methods = new HashSet<AnnotatedMethod<? super X>>();
       for (AnnotatedMethod<? super X> method : getDelegate().getMethods())
       {
-         MetaData MethodMetaData = getMetaData().getComponentMetaData(new MethodSignature(method.getJavaMember()));
+         MetaData MethodMetaData =  getMetaData() == null ? null : getMetaData().getComponentMetaData(new MethodSignature(method.getJavaMember()));
          methods.add(new MDRAnnotatedMethod<X>(this, method, MethodMetaData, getMetaData()));
       }
       return methods;

Modified: projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/dependency/WeldControllerInitializer.java
===================================================================
--- projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/dependency/WeldControllerInitializer.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/main/java/org/jboss/kernel/weld/plugins/dependency/WeldControllerInitializer.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -23,6 +23,8 @@
 
 import org.jboss.dependency.spi.Controller;
 import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.plugins.annotations.Jsr330InjectFilter;
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 
 /**
  * Helper to add the Web Beans controller context actions to the controller
@@ -34,6 +36,7 @@
 {
    static void initializeController(Controller controller)
    {
+      Jsr330InjectFilter.INSTANCE.addIgnoredAnnotation(Weld.class);
       controller.addState(WeldPostConstructAction.STATE, ControllerState.CONFIGURED);
       controller.addState(WeldPreDestroyAction.STATE, ControllerState.START);
    }

Copied: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/InjectAnnotatedIgnoreInjectBean.java (from rev 101406, projects/kernel/branches/jsr330/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/InjectAnnotatedIgnoreInjectBean.java)
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/InjectAnnotatedIgnoreInjectBean.java	                        (rev 0)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/InjectAnnotatedIgnoreInjectBean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,61 @@
+/*
+* 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.kernel.weld.annotated.support;
+
+import javax.inject.Inject;
+
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InjectAnnotatedIgnoreInjectBean
+{
+   @Inject
+   public int hidden;
+   
+   @Inject
+   public int weld;
+   
+   @Inject
+   public InjectAnnotatedIgnoreInjectBean(@Test1("XXX") int param)
+   {
+   }
+
+   @Inject
+   public InjectAnnotatedIgnoreInjectBean(@Test1("XXX") long param)
+   {
+   }
+   
+   @Inject
+   public void hidden(@Test1("XXX") int param)
+   {
+   }
+   
+   @Inject
+   public void weld(@Test1("XXX") int param)
+   {
+   }
+
+}

Copied: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/NotAnnotatedIgnoreInjectBean.java (from rev 101406, projects/kernel/branches/jsr330/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/NotAnnotatedIgnoreInjectBean.java)
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/NotAnnotatedIgnoreInjectBean.java	                        (rev 0)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/NotAnnotatedIgnoreInjectBean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -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.kernel.weld.annotated.support;
+
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class NotAnnotatedIgnoreInjectBean
+{
+   public int hidden;
+   
+   public int weld;
+   
+   public NotAnnotatedIgnoreInjectBean(@Test1("XXX") int param)
+   {
+   }
+
+   public NotAnnotatedIgnoreInjectBean(@Test1("XXX") long param)
+   {
+   }
+   
+   public void hidden(@Test1("XXX") int param)
+   {
+   }
+   
+   public void weld(@Test1("XXX") int param)
+   {
+   }
+
+}

Copied: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAndInjectAnnotatedIgnoreInjectBean.java (from rev 101406, projects/kernel/branches/jsr330/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAndInjectAnnotatedIgnoreInjectBean.java)
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAndInjectAnnotatedIgnoreInjectBean.java	                        (rev 0)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAndInjectAnnotatedIgnoreInjectBean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,64 @@
+/*
+* 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.kernel.weld.annotated.support;
+
+import javax.inject.Inject;
+
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class WeldAndInjectAnnotatedIgnoreInjectBean
+{
+   @Inject
+   public int hidden;
+   
+   @Weld
+   @Inject
+   public int weld;
+   
+   @Inject
+   public WeldAndInjectAnnotatedIgnoreInjectBean(@Test1("XXX") int param)
+   {
+   }
+
+   @Weld
+   @Inject
+   public WeldAndInjectAnnotatedIgnoreInjectBean(@Test1("XXX") long param)
+   {
+   }
+   
+   @Inject
+   public void hidden(@Test1("XXX") int param)
+   {
+   }
+   
+   @Weld
+   @Inject
+   public void weld(@Test1("XXX") int param)
+   {
+   }
+
+}

Copied: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAnnotatedIgnoreInjectBean.java (from rev 101406, projects/kernel/branches/jsr330/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAnnotatedIgnoreInjectBean.java)
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAnnotatedIgnoreInjectBean.java	                        (rev 0)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/support/WeldAnnotatedIgnoreInjectBean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,56 @@
+/*
+* 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.kernel.weld.annotated.support;
+
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class WeldAnnotatedIgnoreInjectBean
+{
+   public int hidden;
+   
+   @Weld
+   public int weld;
+   
+   public WeldAnnotatedIgnoreInjectBean(@Test1("XXX") int param)
+   {
+   }
+
+   @Weld
+   public WeldAnnotatedIgnoreInjectBean(@Test1("XXX") long param)
+   {
+   }
+   
+   public void hidden(@Test1("XXX") int param)
+   {
+   }
+   
+   @Weld
+   public void weld(@Test1("XXX") int param)
+   {
+   }
+
+}

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/test/AnnotatedTypeTestCase.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/test/AnnotatedTypeTestCase.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/annotated/test/AnnotatedTypeTestCase.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -33,11 +33,13 @@
 import javax.enterprise.inject.spi.AnnotatedMethod;
 import javax.enterprise.inject.spi.AnnotatedParameter;
 import javax.enterprise.inject.spi.AnnotatedType;
+import javax.inject.Inject;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
 import org.jboss.annotation.factory.AnnotationCreator;
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 import org.jboss.kernel.weld.spi.annotated.MDRAnnotatedTypeFactory;
 import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader;
 import org.jboss.metadata.spi.MetaData;
@@ -49,12 +51,16 @@
 import org.jboss.metadata.spi.signature.MethodSignature;
 import org.jboss.test.kernel.weld.AbstractWeldMcTest;
 import org.jboss.test.kernel.weld.annotated.support.AnnotatedBean;
+import org.jboss.test.kernel.weld.annotated.support.InjectAnnotatedIgnoreInjectBean;
+import org.jboss.test.kernel.weld.annotated.support.NotAnnotatedIgnoreInjectBean;
+import org.jboss.test.kernel.weld.annotated.support.WeldAndInjectAnnotatedIgnoreInjectBean;
 import org.jboss.test.kernel.weld.annotated.support.Child;
 import org.jboss.test.kernel.weld.annotated.support.NotAnnotatedBean;
 import org.jboss.test.kernel.weld.annotated.support.Parent;
 import org.jboss.test.kernel.weld.annotated.support.Test1;
 import org.jboss.test.kernel.weld.annotated.support.Test2;
 import org.jboss.test.kernel.weld.annotated.support.Test3;
+import org.jboss.test.kernel.weld.annotated.support.WeldAnnotatedIgnoreInjectBean;
 
 /**
  * 
@@ -63,6 +69,8 @@
  */
 public class AnnotatedTypeTestCase extends AbstractWeldMcTest
 {
+   private static final String MDR_ANNOTATED_TYPE_NAME = "org.jboss.kernel.weld.plugins.annotated.MDRAnnotatedType";
+   
    public AnnotatedTypeTestCase(String name)
    {
       super(name);
@@ -90,12 +98,14 @@
    public void testNoAnnotationsOnClassNullMetaData() throws Exception
    {
       AnnotatedType<NotAnnotatedBean> type = createAnnotatedType(NotAnnotatedBean.class, null);
+      assertMDRAnnotated(type);
       checkNotAnnotatedNoAnnotations(type);
    }
    
    public void testNoAnnotationsOnClassEmptyMetaData() throws Exception
    {
       AnnotatedType<NotAnnotatedBean> type = createAnnotatedType(NotAnnotatedBean.class, createEmptyMetaData());
+      assertMDRAnnotated(type);
       checkNotAnnotatedNoAnnotations(type);
    }
    
@@ -104,7 +114,8 @@
    {
       MetaData metaData = createMetaDataWithAnnotations(NotAnnotatedBean.class);
       AnnotatedType<NotAnnotatedBean> type = createAnnotatedType(NotAnnotatedBean.class, metaData);
-      
+      assertMDRAnnotated(type);
+            
       assertAnnotations(type, "A", Test1.class, Test2.class);
       
       assertSize(2, type.getConstructors());
@@ -147,12 +158,14 @@
    public void testAnnotationsOnClassNullMetaData() throws Exception
    {
       AnnotatedType<AnnotatedBean> type = createAnnotatedType(AnnotatedBean.class, null);
+      assertMDRAnnotated(type);
       checkAnnotatedBeanNoMetaData(type);
    }
    
    public void testAnnotationsOnClassEmptyMetaData() throws Exception
    {
       AnnotatedType<AnnotatedBean> type = createAnnotatedType(AnnotatedBean.class, createEmptyMetaData());
+      assertMDRAnnotated(type);
       checkAnnotatedBeanNoMetaData(type);
    }
    
@@ -161,7 +174,8 @@
    {
       MetaData metaData = createMetaDataWithAnnotations(AnnotatedBean.class);
       AnnotatedType<AnnotatedBean> type = createAnnotatedType(AnnotatedBean.class, metaData);
-      
+      assertMDRAnnotated(type);
+            
       assertAnnotations(type, "A", Test1.class, Test2.class, Test3.class);
       
       assertSize(2, type.getConstructors());
@@ -315,6 +329,185 @@
       }
    }
    
+   public void testNonWeldInjectIgnoredAllAnnotations() throws Exception
+   {
+      AnnotatedType<WeldAndInjectAnnotatedIgnoreInjectBean> type = createAnnotatedType(WeldAndInjectAnnotatedIgnoreInjectBean.class, null);
+      checkNonWeldInjectIgnored(type);
+   }
+   
+   public void testNonWeldInjectIgnoredWeldFromAnnotations() throws Exception
+   {
+      MemoryMetaDataLoader loader = new MemoryMetaDataLoader();
+      
+      Class<?> clazz = InjectAnnotatedIgnoreInjectBean.class; 
+      Constructor<?> weldConstructor = clazz.getDeclaredConstructor(Long.TYPE);
+      MemoryMetaDataLoader component = new MemoryMetaDataLoader();
+      component.addAnnotation(createWeld());
+      loader.addComponentMetaDataRetrieval(new ConstructorSignature(weldConstructor), component);
+      
+      Field weldField = clazz.getDeclaredField("weld");
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createWeld());
+      loader.addComponentMetaDataRetrieval(new FieldSignature(weldField), component);
+
+      Method weldMethod = clazz.getDeclaredMethod("weld", Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createWeld());
+      loader.addComponentMetaDataRetrieval(new MethodSignature(weldMethod), component);
+      
+      MetaData metaData = new MetaDataRetrievalToMetaDataBridge(loader);
+      
+      AnnotatedType<InjectAnnotatedIgnoreInjectBean> type = createAnnotatedType(InjectAnnotatedIgnoreInjectBean.class, metaData);
+      checkNonWeldInjectIgnored(type);
+   }
+   
+   public void testNonWeldInjectIgnoredInjectFromAnnotations() throws Exception
+   {
+      MemoryMetaDataLoader loader = new MemoryMetaDataLoader();
+      
+      Class<?> clazz = InjectAnnotatedIgnoreInjectBean.class; 
+      Constructor<?> weldConstructor = clazz.getDeclaredConstructor(Long.TYPE);
+      MemoryMetaDataLoader component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new ConstructorSignature(weldConstructor), component);
+
+      Constructor<?> hiddenConstructor = clazz.getDeclaredConstructor(Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new ConstructorSignature(hiddenConstructor), component);
+      
+      Field weldField = clazz.getDeclaredField("weld");
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new FieldSignature(weldField), component);
+
+      Field hiddenField = clazz.getDeclaredField("hidden");
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new FieldSignature(hiddenField), component);
+
+      Method weldMethod = clazz.getDeclaredMethod("weld", Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new MethodSignature(weldMethod), component);
+      
+      Method hiddenMethod = clazz.getDeclaredMethod("hidden", Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new MethodSignature(hiddenMethod), component);
+      
+      MetaData metaData = new MetaDataRetrievalToMetaDataBridge(loader);
+      
+      AnnotatedType<WeldAnnotatedIgnoreInjectBean> type = createAnnotatedType(WeldAnnotatedIgnoreInjectBean.class, metaData);
+      checkNonWeldInjectIgnored(type);
+   }
+   
+   public void testNonWeldInjectIgnoredNoAnnotations() throws Exception
+   {
+      MemoryMetaDataLoader loader = new MemoryMetaDataLoader();
+      
+      Class<?> clazz = InjectAnnotatedIgnoreInjectBean.class; 
+      Constructor<?> weldConstructor = clazz.getDeclaredConstructor(Long.TYPE);
+      MemoryMetaDataLoader component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      component.addAnnotation(createWeld());
+      loader.addComponentMetaDataRetrieval(new ConstructorSignature(weldConstructor), component);
+
+      Constructor<?> hiddenConstructor = clazz.getDeclaredConstructor(Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new ConstructorSignature(hiddenConstructor), component);
+      
+      Field weldField = clazz.getDeclaredField("weld");
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      component.addAnnotation(createWeld());
+      loader.addComponentMetaDataRetrieval(new FieldSignature(weldField), component);
+
+      Field hiddenField = clazz.getDeclaredField("hidden");
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new FieldSignature(hiddenField), component);
+
+      Method weldMethod = clazz.getDeclaredMethod("weld", Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      component.addAnnotation(createWeld());
+      loader.addComponentMetaDataRetrieval(new MethodSignature(weldMethod), component);
+      
+      Method hiddenMethod = clazz.getDeclaredMethod("hidden", Integer.TYPE);
+      component = new MemoryMetaDataLoader();
+      component.addAnnotation(createInject());
+      loader.addComponentMetaDataRetrieval(new MethodSignature(hiddenMethod), component);
+      
+      MetaData metaData = new MetaDataRetrievalToMetaDataBridge(loader);
+      
+      AnnotatedType<NotAnnotatedIgnoreInjectBean> type = createAnnotatedType(NotAnnotatedIgnoreInjectBean.class, metaData);
+      checkNonWeldInjectIgnored(type);
+   }
+   
+   private void checkNonWeldInjectIgnored(AnnotatedType<?> type) throws Exception
+   {
+      assertMDRAnnotated(type);
+      assertSize(2, type.getFields());
+      for (AnnotatedField<?> field : type.getFields())
+      {
+         if (field.getJavaMember().getName().equals("weld"))
+         {
+            assertAnnotations(field, null, Weld.class, Inject.class);
+         }
+         else if (field.getJavaMember().getName().equals("hidden"))
+         {
+            assertNoAnnotations(field);
+            assertNoInject(field);
+         }
+         else
+         {
+            fail("Unknown field");
+         }
+      }
+      
+      assertSize(2, type.getConstructors());
+      for (AnnotatedConstructor<?> ctor : type.getConstructors())
+      {
+         if (ctor.getJavaMember().getParameterTypes().length != 1)
+            fail("Unknown constructor");
+         if (ctor.getJavaMember().getParameterTypes()[0].equals(Integer.TYPE))
+         {
+            assertNoAnnotations(ctor);
+            assertNoInject(ctor);
+            assertAnnotations(ctor.getParameters().get(0), "XXX", Test1.class);
+         }
+         else if (ctor.getJavaMember().getParameterTypes()[0].equals(Long.TYPE))
+         {
+            assertAnnotations(ctor, null, Weld.class, Inject.class);
+            assertAnnotations(ctor.getParameters().get(0), "XXX", Test1.class);
+         }
+         else
+            fail("Unknown constructor");
+      }
+      
+      assertSize(2, type.getMethods());
+      for (AnnotatedMethod<?> method : type.getMethods())
+      {
+         if (method.getJavaMember().getName().equals("weld"))
+         {
+            assertAnnotations(method, null, Weld.class, Inject.class);
+            assertAnnotations(method.getParameters().get(0), "XXX", Test1.class);
+         }
+         else if (method.getJavaMember().getName().equals("hidden"))
+         {
+            assertNoAnnotations(method);
+            assertNoInject(method);
+            assertAnnotations(method.getParameters().get(0), "XXX", Test1.class);
+         }
+         else
+            fail("Unknown method");
+      }
+   }
+
+   
+   
    @SuppressWarnings("unchecked")
    private void checkAnnotationsOnParentClass(AnnotatedType<? super Child> type)
    {
@@ -333,34 +526,34 @@
    
    private void checkNotAnnotatedNoAnnotations(AnnotatedType<?> type)
    {
-      assertAnnotations(type);
+      assertNoAnnotations(type);
       
       assertSize(2, type.getConstructors());
       for (AnnotatedConstructor<?> ctor : type.getConstructors())
       {
-         assertAnnotations(ctor);
+         assertNoAnnotations(ctor);
          
          for (AnnotatedParameter<?> param : ctor.getParameters())
          {
-            assertAnnotations(param);
+            assertNoAnnotations(param);
          }
       }
       
       assertSize(2, type.getMethods());
       for (AnnotatedMethod<?> method : type.getMethods())
       {
-         assertAnnotations(method);
+         assertNoAnnotations(method);
          
          for (AnnotatedParameter<?> param : method.getParameters())
          {
-            assertAnnotations(param);
+            assertNoAnnotations(param);
          }
       }
       
       assertSize(1, type.getFields());
       for (AnnotatedField<?> field : type.getFields())
       {
-         assertAnnotations(field);
+         assertNoAnnotations(field);
       }
    }
    
@@ -398,15 +591,21 @@
       }
    }
    
-   private void assertAnnotations(Annotated annotated)
+   private void assertNoInject(Annotated annotated)
    {
+      assertNull(annotated.getAnnotation(Inject.class));
+      assertFalse(annotated.isAnnotationPresent(Inject.class));
+   }
+   
+   private void assertNoAnnotations(Annotated annotated)
+   {
       assertAnnotations(annotated, null);
    }
    
    private void assertAnnotations(Annotated annotated, String test1String, Class<? extends Annotation>...annotations)
    {
       Set<Annotation> actual = annotated.getAnnotations();
-      assertEquals(actual.size(), annotations.length);
+      assertEquals(annotations.length, actual.size());
       
       for (Class<? extends Annotation> clazz : annotations)
       {
@@ -428,6 +627,7 @@
          assertEquals(found, ann);
          if (clazz == Test1.class && test1String != null)
             assertEquals(test1String, ((Test1)ann).value());
+         assertTrue(annotated.isAnnotationPresent(clazz));
       }
    }
    
@@ -539,4 +739,20 @@
    {
       return (Test2)AnnotationCreator.createAnnotation("@" + Test2.class.getName(), (ClassLoader)null);
    }
+   
+   private Weld createWeld() throws Exception
+   {
+      return (Weld)AnnotationCreator.createAnnotation("@" + Weld.class.getName(), (ClassLoader)null);
+   }
+   
+   private Inject createInject() throws Exception
+   {
+      return (Inject)AnnotationCreator.createAnnotation("@" + Inject.class.getName(), (ClassLoader)null);
+   }
+   
+   private void assertMDRAnnotated(AnnotatedType<?> type)
+   {
+      assertNotNull(type);
+      assertEquals(MDR_ANNOTATED_TYPE_NAME, type.getClass().getName());
+   }
 }

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/First.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/First.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/First.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -24,6 +24,8 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -32,7 +34,7 @@
 @Default
 public class First
 {
-   @Inject Middle middle;
+   @Weld @Inject Middle middle;
 
    public Middle getMiddle()
    {

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/Middle.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/Middle.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/bidirectional/support/Middle.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -24,6 +24,8 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -32,7 +34,7 @@
 @Default
 public class Middle
 {
-   @Inject Last last;
+   @Weld @Inject Last last;
 
    public Last getLast()
    {

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBean.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBean.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -24,7 +24,9 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -34,12 +36,12 @@
 {
    WebBean beanFromConstructor;
    
-   @Inject @Default
+   @Weld @Inject @Default
    WebBean bean;
    
    WebBean nonInject;
    
-   @Inject
+   @Weld @Inject
    public McBean(@Default WebBean beanFromConstructor)
    {
       this.beanFromConstructor = beanFromConstructor;

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInitializerMethod.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInitializerMethod.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInitializerMethod.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -24,7 +24,9 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -36,7 +38,7 @@
    
    WebBean nonInject;
    
-   @Inject
+   @Weld @Inject
    public void initializerMethod(@Default WebBean bean)
    {
       this.bean = bean;

Copied: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInjectedFromWeldAndMcFields.java (from rev 101406, projects/kernel/branches/jsr330/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInjectedFromWeldAndMcFields.java)
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInjectedFromWeldAndMcFields.java	                        (rev 0)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanInjectedFromWeldAndMcFields.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -0,0 +1,50 @@
+/*
+* 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.kernel.weld.wbtomc.support;
+
+import javax.inject.Inject;
+
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class McBeanInjectedFromWeldAndMcFields
+{
+   @Inject 
+   public Simple simple;
+   
+   @Weld @Inject 
+   public WebBean webBean;
+
+   public Simple getSimple()
+   {
+      return simple;
+   }
+
+   public WebBean getWebBean()
+   {
+      return webBean;
+   }
+}

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanMcConstructor.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanMcConstructor.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanMcConstructor.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -24,7 +24,9 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -32,7 +34,7 @@
  */
 public class McBeanMcConstructor
 {
-   @Inject @Default
+   @Weld @Inject @Default
    WebBean bean;
    
    Simple simple;

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanWithPostConstructAndPreDestroy.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanWithPostConstructAndPreDestroy.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/McBeanWithPostConstructAndPreDestroy.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -26,7 +26,9 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -34,14 +36,14 @@
  */
 public class McBeanWithPostConstructAndPreDestroy
 {
-   @Inject @Default
+   @Weld @Inject @Default
    WebBean bean;
    
    boolean postConstructCalled;
    
    boolean preDestroyCalled;
    
-   @Inject
+   @Weld @Inject
    public McBeanWithPostConstructAndPreDestroy()
    {
    }

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/MissingDependenciesFieldBean.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/MissingDependenciesFieldBean.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/support/MissingDependenciesFieldBean.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -24,7 +24,9 @@
 import javax.enterprise.inject.Default;
 import javax.inject.Inject;
 
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -32,5 +34,5 @@
  */
 public class MissingDependenciesFieldBean
 {
-   @Inject @Default @Bean WebBean bean;
+   @Weld @Inject @Default @Bean WebBean bean;
 }

Modified: projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/test/InjectWeldInMcBeansTestCase.java
===================================================================
--- projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/test/InjectWeldInMcBeansTestCase.java	2010-02-24 16:01:57 UTC (rev 101406)
+++ projects/kernel/trunk/weld-int/src/test/java/org/jboss/test/kernel/weld/wbtomc/test/InjectWeldInMcBeansTestCase.java	2010-02-24 16:25:16 UTC (rev 101407)
@@ -47,6 +47,7 @@
 import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
 import org.jboss.dependency.spi.ControllerContext;
 import org.jboss.dependency.spi.ControllerState;
+import org.jboss.kernel.weld.metadata.api.annotations.Weld;
 import org.jboss.kernel.weld.plugins.dependency.WeldKernelControllerContext;
 import org.jboss.test.kernel.weld.AbstractWeldMcTest;
 import org.jboss.test.kernel.weld.wbtomc.support.ExternalBeanConstructor;
@@ -56,6 +57,7 @@
 import org.jboss.test.kernel.weld.wbtomc.support.McBean;
 import org.jboss.test.kernel.weld.wbtomc.support.McBeanAnnotationsFromMetaData;
 import org.jboss.test.kernel.weld.wbtomc.support.McBeanInitializerMethod;
+import org.jboss.test.kernel.weld.wbtomc.support.McBeanInjectedFromWeldAndMcFields;
 import org.jboss.test.kernel.weld.wbtomc.support.McBeanMcConstructor;
 import org.jboss.test.kernel.weld.wbtomc.support.McBeanWithPostConstructAndPreDestroy;
 import org.jboss.test.kernel.weld.wbtomc.support.MissingDependenciesConstructorBean;
@@ -344,11 +346,14 @@
       metaData.setAccessMode(BeanAccessMode.ALL);
       
       AbstractConstructorMetaData ctor = new AbstractConstructorMetaData();
-      AnnotationMetaData initializer = new AbstractAnnotationMetaData("@" + Inject.class.getName());
-      ctor.setAnnotations(Collections.singleton(initializer));
+      Set<AnnotationMetaData> annotations = new HashSet<AnnotationMetaData>();
+      annotations.add(new AbstractAnnotationMetaData("@" + Inject.class.getName()));
+      annotations.add(new AbstractAnnotationMetaData("@" + Weld.class.getName()));
+      ctor.setAnnotations(annotations);
       AbstractParameterMetaData param = new AbstractParameterMetaData(WebBean.class.getName(), (String)null);
-      AnnotationMetaData current = new AbstractAnnotationMetaData("@" + Default.class.getName());
-      param.setAnnotations(Collections.singleton(current));
+      annotations = new HashSet<AnnotationMetaData>();
+      annotations.add(new AbstractAnnotationMetaData("@" + Default.class.getName()));
+      param.setAnnotations(annotations);
       ctor.setParameters(Collections.singletonList((ParameterMetaData)param));
       metaData.setConstructor(ctor);
       
@@ -356,6 +361,7 @@
       Set<AnnotationMetaData> propertyAnns = new HashSet<AnnotationMetaData>();
       propertyAnns.add(new AbstractAnnotationMetaData("@" + Default.class.getName()));
       propertyAnns.add(new AbstractAnnotationMetaData("@" + Inject.class.getName()));
+      propertyAnns.add(new AbstractAnnotationMetaData("@" + Weld.class.getName()));
 
       property.setAnnotations(propertyAnns);
       metaData.addProperty(property);
@@ -374,6 +380,32 @@
          undeploy(context);
       }
    }
+   
+   public void testInjectFromWeldAndMc() throws Exception
+   {
+      WeldKernelControllerContext simpleContext = null;
+      WeldKernelControllerContext mcContext = null;
+      
+      try
+      {
+         simpleContext = deploy(new AbstractBeanMetaData("Simple", Simple.class.getName()));
+         AbstractBeanMetaData metaData = new AbstractBeanMetaData("McBean", McBeanInjectedFromWeldAndMcFields.class.getName());
+         metaData.setAccessMode(BeanAccessMode.ALL);
+         mcContext = deploy(metaData);
+         
+         Simple simple = assertBean("Simple", Simple.class);
+         McBeanInjectedFromWeldAndMcFields mcBean = assertBean("McBean", McBeanInjectedFromWeldAndMcFields.class);
+         
+         assertNotNull(mcBean.getSimple());
+         assertNotNull(mcBean.getWebBean());
+         assertEquals(simple, mcBean.getSimple());
+      }
+      finally
+      {
+         undeploy(mcContext);
+         undeploy(simpleContext);
+      }
+   }
 
    public class NonContextual<T> {
 




More information about the jboss-cvs-commits mailing list