You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2010/02/13 12:33:32 UTC

svn commit: r909797 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/component/ main/java/org/apache/webbeans/config/ main/java/org/apache/webbeans/container/ main/java/org/apache/webbeans/portable/creation/ main/java/org/apach...

Author: gerdogdu
Date: Sat Feb 13 11:33:31 2010
New Revision: 909797

URL: http://svn.apache.org/viewvc?rev=909797&view=rev
Log:
[OWB-268] Update and adding test

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Chair.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionBean.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionTest.java   (with props)
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Table.java   (with props)
Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java Sat Feb 13 11:33:31 2010
@@ -75,6 +75,9 @@
     /**Annotated type for bean*/
     private AnnotatedType<T> annotatedType;
     
+    /**Fully initialize, true as default*/
+    private boolean fullyInitialize = true;
+    
     /**
      * Holds the all of the interceptor related data, contains around-invoke,
      * post-construct and pre-destroy
@@ -147,6 +150,11 @@
         beforeConstructor();
 
         T instance = createComponentInstance(creationalContext);
+        
+        if(!isFullyInitialize())
+        {
+            return instance;
+        }
                 
         //Push instance into creational context, this is necessary because
         //Context objects look for instance in the interceptors. If we do not
@@ -611,4 +619,22 @@
     {
         this.annotatedType = annotatedType;
     }
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void setFullyInitialize(boolean initialize)
+    {
+        this.fullyInitialize = initialize;
+    }
+    
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isFullyInitialize()
+    {
+        return this.fullyInitialize;
+    }    
 }
\ No newline at end of file

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/InjectionTargetBean.java Sat Feb 13 11:33:31 2010
@@ -196,4 +196,17 @@
      * @return annotated type
      */
     public AnnotatedType<T> getAnnotatedType();    
+    
+    /**
+     * If fully initialize then fully initialize instance
+     * otherwise just create instance.
+     * @param initialize fully initialize
+     */
+    public void setFullyInitialize(boolean initialize);
+    
+    /**
+     * Gets fully initialize.
+     * @return fully initialize
+     */
+    public boolean isFullyInitialize();
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Sat Feb 13 11:33:31 2010
@@ -43,7 +43,6 @@
 import org.apache.webbeans.config.OWBLogConst;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.decorator.WebBeansDecorator;
-import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
 import org.apache.webbeans.deployment.StereoTypeManager;
 import org.apache.webbeans.deployment.StereoTypeModel;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
@@ -293,7 +292,7 @@
                         !(bean instanceof NewBean) &&
                         !(bean instanceof EnterpriseBeanMarker))
                 {
-                    WebBeansDecoratorConfig.configureDecarotors((AbstractInjectionTargetBean<Object>)bean);
+                    DefinitionUtil.defineDecoratorStack((AbstractInjectionTargetBean<Object>)bean);
                     DefinitionUtil.defineBeanInterceptorStack((AbstractInjectionTargetBean<Object>)bean);
                 }
                 

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java Sat Feb 13 11:33:31 2010
@@ -60,6 +60,7 @@
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.container.ExternalScope;
 import org.apache.webbeans.container.InjectionResolver;
+import org.apache.webbeans.decorator.WebBeansDecoratorConfig;
 import org.apache.webbeans.event.EventUtil;
 import org.apache.webbeans.event.NotificationManager;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
@@ -1048,6 +1049,10 @@
         WebBeansInterceptorConfig.configure(bean, bean.getInterceptorStack());
     }
 
+    public static void defineDecoratorStack(AbstractInjectionTargetBean<?> bean)
+    {
+        WebBeansDecoratorConfig.configureDecarotors((AbstractInjectionTargetBean<Object>)bean);
+    }
 
     public static <T> Set<ObserverMethod<?>> defineObserverMethods(InjectionTargetBean<T> component, Class<T> clazz)
     {

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java Sat Feb 13 11:33:31 2010
@@ -50,6 +50,7 @@
 
 import org.apache.webbeans.component.AbstractOwbBean;
 import org.apache.webbeans.component.EnterpriseBeanMarker;
+import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.JmsBeanMarker;
 import org.apache.webbeans.component.third.ThirdpartyBeanImpl;
 import org.apache.webbeans.config.WebBeansFinder;
@@ -639,7 +640,15 @@
         }
         
         //Owner bean creational context
-        CreationalContextImpl<?> ownerCreationalContextImpl = (CreationalContextImpl<?>)ownerCreationalContext;
+        CreationalContextImpl<?> ownerCreationalContextImpl = null;
+        if(!(ownerCreationalContext instanceof CreationalContextImpl))
+        {
+            ownerCreationalContextImpl = (CreationalContextImpl<?>)CreationalContextFactory.getInstance().wrappedCreationalContext(ownerCreationalContext, injectionPoint.getBean());
+        }
+        else
+        {
+            ownerCreationalContextImpl = (CreationalContextImpl<?>)ownerCreationalContext;
+        }
                                 
         //Find the injection point Bean
         Bean<Object> injectedBean = (Bean<Object>)injectionResolver.getInjectionPointBean(injectionPoint);
@@ -647,7 +656,7 @@
         
         if(WebBeansUtil.isDependent(injectedBean))
         {        
-            injectedCreational.setOwnerCreational((CreationalContextImpl<?>)ownerCreationalContext);            
+            injectedCreational.setOwnerCreational(ownerCreationalContextImpl);            
             //Creating a new creational context for target bean instance
             instance = getReference(injectedBean, injectionPoint.getType(), injectedCreational);
             
@@ -723,6 +732,12 @@
             
         }
         
+        if(!(creationalContext instanceof CreationalContextImpl))
+        {
+            creationalContext = CreationalContextFactory.getInstance().wrappedCreationalContext(creationalContext, bean);
+        }        
+        
+        
         //Get bean context
         context = getContext(bean.getScope());
         
@@ -749,11 +764,8 @@
                     this.proxyMap.put(bean, instance);   
 
                     //push this proxy instance into creational context
-                    if(creationalContext instanceof CreationalContextImpl)
-                    {
-                        CreationalContextImpl<Object> temp = (CreationalContextImpl<Object>)creationalContext;
-                        temp.setProxyInstance(instance);
-                    }
+                    CreationalContextImpl<Object> temp = (CreationalContextImpl<Object>)creationalContext;
+                    temp.setProxyInstance(instance);
                 }
             }            
         }
@@ -946,7 +958,10 @@
     @Override
     public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
     {
-        return new InjectionTargetProducer<T>(WebBeansAnnotatedTypeUtil.defineManagedBean(type));
+        InjectionTargetBean<T> bean = WebBeansAnnotatedTypeUtil.defineManagedBean(type);
+        bean.setFullyInitialize(false);
+        
+        return new InjectionTargetProducer<T>(bean);
     }
 
     @Override

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/AbstractProducer.java Sat Feb 13 11:33:31 2010
@@ -19,7 +19,7 @@
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.Producer;
 
-import org.apache.webbeans.component.AbstractOwbBean;
+import org.apache.webbeans.component.OwbBean;
 
 /**
  * Abstract implementation of {@link Producer} contract.
@@ -31,14 +31,14 @@
 public abstract class AbstractProducer<T> implements Producer<T> 
 {
     /**Bean instance*/
-    private AbstractOwbBean<T> bean;
+    private OwbBean<T> bean;
 
     /**
      * Create a new producer with given bean.
      * 
      * @param bean bean instance
      */
-    protected AbstractProducer(AbstractOwbBean<T> bean)
+    protected AbstractProducer(OwbBean<T> bean)
     {
         this.bean = bean;
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/creation/InjectionTargetProducer.java Sat Feb 13 11:33:31 2010
@@ -16,7 +16,6 @@
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.InjectionTarget;
 
-import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.InjectionTargetBean;
 
 /**
@@ -28,7 +27,7 @@
  */
 public class InjectionTargetProducer<T> extends AbstractProducer<T> implements InjectionTarget<T>
 {
-    public InjectionTargetProducer(AbstractInjectionTargetBean<T> bean)
+    public InjectionTargetProducer(InjectionTargetBean<T> bean)
     {
         super(bean);
     }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java?rev=909797&r1=909796&r2=909797&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansAnnotatedTypeUtil.java Sat Feb 13 11:33:31 2010
@@ -742,7 +742,8 @@
     {
         Class<T> clazz = type.getJavaClass();
         
-        ManagedBean<T> managedBean = new ManagedBean<T>(clazz,WebBeansType.MANAGED);                  
+        ManagedBean<T> managedBean = new ManagedBean<T>(clazz,WebBeansType.MANAGED);    
+        managedBean.setAnnotatedType(type);
         AnnotatedTypeBeanCreatorImpl<T> managedBeanCreator = new AnnotatedTypeBeanCreatorImpl<T>(managedBean);            
         managedBeanCreator.setAnnotatedType(type);
         
@@ -765,6 +766,8 @@
         managedBeanCreator.defineInjectedFields();
         managedBeanCreator.defineInjectedMethods();
         managedBeanCreator.defineObserverMethods();
+        DefinitionUtil.defineDecoratorStack(managedBean);
+        DefinitionUtil.defineBeanInterceptorStack(managedBean);
                                 
         
         DecoratorUtil.checkManagedBeanDecoratorConditions(managedBean);

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Chair.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Chair.java?rev=909797&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Chair.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Chair.java Sat Feb 13 11:33:31 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.portable.injectiontarget.supportInjections;
+
+import javax.enterprise.context.RequestScoped;
+
+import org.apache.webbeans.test.annotation.binding.Binding1;
+
+@Binding1
+@RequestScoped
+public class Chair
+{
+
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Chair.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionBean.java?rev=909797&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionBean.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionBean.java Sat Feb 13 11:33:31 2010
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.portable.injectiontarget.supportInjections;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.enterprise.inject.New;
+import javax.inject.Inject;
+
+import org.apache.webbeans.newtests.promethods.common.Person;
+import org.apache.webbeans.test.annotation.binding.Binding1;
+import org.apache.webbeans.test.annotation.binding.Binding2;
+
+public class SupportInjectionBean
+{
+    private @Inject @Binding1 Chair chair;
+    
+    private @Inject @Binding2 Table table;
+    
+    public static boolean POST_COSTRUCT = false;
+    
+    public static boolean PRE_DESTROY = false;
+    
+    private Person person;
+    
+    @Inject
+    public SupportInjectionBean(@New Person person)
+    {
+        this.person = person;
+    }
+    
+    public Person getPerson()
+    {
+        return this.person;
+    }
+    
+    
+    /**
+     * @return the chair
+     */
+    public Chair getChair()
+    {
+        return chair;
+    }
+
+
+
+    /**
+     * @param chair the chair to set
+     */
+    public void setChair(Chair chair)
+    {
+        this.chair = chair;
+    }
+
+
+
+    /**
+     * @return the table
+     */
+    public Table getTable()
+    {
+        return table;
+    }
+
+
+
+    /**
+     * @param table the table to set
+     */
+    public void setTable(Table table)
+    {
+        this.table = table;
+    }
+
+
+
+    @PostConstruct
+    public void postConstruct()
+    {
+        POST_COSTRUCT = true;
+    }
+    
+    @PreDestroy
+    public void preDestroy()
+    {
+        PRE_DESTROY = true;
+    }
+        
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionTest.java?rev=909797&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionTest.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionTest.java Sat Feb 13 11:33:31 2010
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.portable.injectiontarget.supportInjections;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.newtests.AbstractUnitTest;
+import org.junit.Test;
+
+public class SupportInjectionTest extends AbstractUnitTest
+{
+    class SupportCreational implements CreationalContext<SupportInjectionBean>
+    {
+
+        @Override
+        public void push(SupportInjectionBean incompleteInstance)
+        {
+            // TODO Auto-generated method stub
+            
+        }
+
+        @Override
+        public void release()
+        {
+            // TODO Auto-generated method stub
+            
+        }
+        
+    }
+    
+    @Test
+    public void testInjectionTarget()
+    {
+        Collection<Class<?>> classes = new ArrayList<Class<?>>();
+        classes.add(Chair.class);
+        classes.add(Table.class);
+        startContainer(classes);
+        
+        InjectionTarget<SupportInjectionBean> model = getBeanManager().createInjectionTarget(getBeanManager().createAnnotatedType(SupportInjectionBean.class));
+        SupportCreational cc = new SupportCreational();
+        SupportInjectionBean instance = model.produce(cc);
+        
+        model.inject(instance, cc);
+        
+        Assert.assertNotNull(instance.getChair());
+        Assert.assertNotNull(instance.getTable());
+        Assert.assertNotNull(instance.getPerson());
+        
+        model.postConstruct(instance);
+        Assert.assertTrue(SupportInjectionBean.POST_COSTRUCT);
+        
+        model.preDestroy(instance);
+        Assert.assertTrue(SupportInjectionBean.PRE_DESTROY);
+        
+        shutDownContainer();
+        
+    }
+
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/SupportInjectionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Table.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Table.java?rev=909797&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Table.java (added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Table.java Sat Feb 13 11:33:31 2010
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.webbeans.newtests.portable.injectiontarget.supportInjections;
+
+import javax.enterprise.context.RequestScoped;
+
+import org.apache.webbeans.test.annotation.binding.Binding2;
+
+@Binding2
+@RequestScoped
+public class Table
+{
+
+}

Propchange: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/injectiontarget/supportInjections/Table.java
------------------------------------------------------------------------------
    svn:eol-style = native