openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1628058 - /openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java
Date Sun, 28 Sep 2014 09:12:09 GMT
Author: struberg
Date: Sun Sep 28 09:12:08 2014
New Revision: 1628058

URL: http://svn.apache.org/r1628058
Log:
also add a test for a @Dependent producer passivation check

Modified:
    openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java

Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java?rev=1628058&r1=1628057&r2=1628058&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java
(original)
+++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/test/java/org/apache/webbeans/newtests/promethods/ProducerPassivationTest.java
Sun Sep 28 09:12:08 2014
@@ -16,6 +16,7 @@
  */
 package org.apache.webbeans.newtests.promethods;
 
+import javax.enterprise.context.Dependent;
 import javax.enterprise.context.SessionScoped;
 import javax.enterprise.inject.Produces;
 import javax.inject.Inject;
@@ -68,6 +69,19 @@ public class ProducerPassivationTest ext
         Assert.assertNotNull(instance.getInstance());
     }
 
+    @Test
+    public void testDependentNonSerializableInterfaceInjectionWorks()
+    {
+        List<Class<?>> classes = new ArrayList<Class<?>>();
+        classes.add(DependentSerializableImplProducerOwner.class);
+        classes.add(NonSerializableImplHolder.class);
+        startContainer(classes);
+
+        NonSerializableImplHolder instance = getInstance(NonSerializableImplHolder.class);
+        Assert.assertNotNull(instance);
+        Assert.assertNotNull(instance.getInstance());
+    }
+
     @Test(expected = WebBeansConfigurationException.class)
     public void testBrokenNonPassivatingProducer()
     {
@@ -96,6 +110,17 @@ public class ProducerPassivationTest ext
         }
     }
 
+    public static class DependentSerializableImplProducerOwner
+    {
+        @Produces
+        @Dependent
+        public NonSerializableInterface createSerializableImpl()
+        {
+            return new SerializableImpl(); // all fine as the actual impl is Serializable
at runtime
+        }
+    }
+
+
     public static class NonSerializableImplHolder
     {
         private @Inject NonSerializableInterface instance;



Mime
View raw message