openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1587747 - in /openwebbeans/trunk/webbeans-impl/src/test: java/org/apache/webbeans/test/decorators/generic/ java/org/apache/webbeans/test/decorators/tests/ resources/org/apache/webbeans/test/decorators/tests/
Date Tue, 15 Apr 2014 23:04:58 GMT
Author: arne
Date: Tue Apr 15 23:04:57 2014
New Revision: 1587747

URL: http://svn.apache.org/r1587747
Log:
OWB-945: Applied patch from Xavier Dury

Added:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedDecoratedBean.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedGenericInterface.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedSampleDecorator.java
Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.java
    openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.xml

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedDecoratedBean.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedDecoratedBean.java?rev=1587747&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedDecoratedBean.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedDecoratedBean.java
Tue Apr 15 23:04:57 2014
@@ -0,0 +1,8 @@
+package org.apache.webbeans.test.decorators.generic;
+
+import javax.enterprise.context.ApplicationScoped;
+
+@ApplicationScoped
+public class ExtendedDecoratedBean extends DecoratedBean implements ExtendedGenericInterface
{
+
+}

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedGenericInterface.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedGenericInterface.java?rev=1587747&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedGenericInterface.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedGenericInterface.java
Tue Apr 15 23:04:57 2014
@@ -0,0 +1,7 @@
+package org.apache.webbeans.test.decorators.generic;
+
+import javax.inject.Scope;
+
+public interface ExtendedGenericInterface extends GenericInterface<Scope> {
+
+}

Added: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedSampleDecorator.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedSampleDecorator.java?rev=1587747&view=auto
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedSampleDecorator.java
(added)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/generic/ExtendedSampleDecorator.java
Tue Apr 15 23:04:57 2014
@@ -0,0 +1,26 @@
+package org.apache.webbeans.test.decorators.generic;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.enterprise.inject.Any;
+import javax.inject.Inject;
+
+@Decorator
+public class ExtendedSampleDecorator implements ExtendedGenericInterface
+{
+
+    @Inject
+    @Any
+    @Delegate
+    private ExtendedGenericInterface delegate;
+
+    @Override
+    public boolean isDecoratorCalled()
+    {
+        if (delegate.isDecoratorCalled())
+        {
+            throw new IllegalStateException();
+        }
+        return true;
+    }
+}

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.java?rev=1587747&r1=1587746&r2=1587747&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.java
Tue Apr 15 23:04:57 2014
@@ -36,6 +36,9 @@ import org.apache.webbeans.test.decorato
 import org.apache.webbeans.test.decorators.common.Garphly;
 import org.apache.webbeans.test.decorators.common.GarphlyDecorator;
 import org.apache.webbeans.test.decorators.generic.DecoratedBean;
+import org.apache.webbeans.test.decorators.generic.ExtendedDecoratedBean;
+import org.apache.webbeans.test.decorators.generic.ExtendedGenericInterface;
+import org.apache.webbeans.test.decorators.generic.ExtendedSampleDecorator;
 import org.apache.webbeans.test.decorators.generic.GenericInterface;
 import org.apache.webbeans.test.decorators.generic.SampleDecorator;
 import org.junit.Test;
@@ -86,4 +89,20 @@ public class GenericDecoratorTest extend
         DecoratedBean decoratedBean = getInstance(DecoratedBean.class);
         Assert.assertTrue(decoratedBean.isDecoratorCalled());
     }
+    
+    @Test
+    public void extendedInjection() throws Exception {
+        Collection<Class<?>> classes = new ArrayList<Class<?>>();
+        classes.add(ExtendedDecoratedBean.class);
+        classes.add(ExtendedGenericInterface.class);
+        classes.add(ExtendedSampleDecorator.class);
+
+        Collection<String> xmls = new ArrayList<String>();
+        xmls.add(getXmlPath(PACKAGE_NAME, "GenericDecoratorTest"));
+
+        startContainer(classes, xmls);
+
+        ExtendedDecoratedBean decoratedBean = getInstance(ExtendedDecoratedBean.class);
+        Assert.assertTrue(decoratedBean.isDecoratorCalled());
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.xml?rev=1587747&r1=1587746&r2=1587747&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.xml
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/resources/org/apache/webbeans/test/decorators/tests/GenericDecoratorTest.xml
Tue Apr 15 23:04:57 2014
@@ -21,5 +21,6 @@ under the License.
    <decorators>
       <class>org.apache.webbeans.test.decorators.common.GarphlyDecorator</class>
       <class>org.apache.webbeans.test.decorators.generic.SampleDecorator</class>
+      <class>org.apache.webbeans.test.decorators.generic.ExtendedSampleDecorator</class>
    </decorators>
 </beans>



Mime
View raw message