Return-Path: X-Original-To: apmail-openwebbeans-commits-archive@www.apache.org Delivered-To: apmail-openwebbeans-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66AE4171C5 for ; Sun, 28 Sep 2014 09:12:32 +0000 (UTC) Received: (qmail 59763 invoked by uid 500); 28 Sep 2014 09:12:32 -0000 Delivered-To: apmail-openwebbeans-commits-archive@openwebbeans.apache.org Received: (qmail 59738 invoked by uid 500); 28 Sep 2014 09:12:32 -0000 Mailing-List: contact commits-help@openwebbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwebbeans.apache.org Delivered-To: mailing list commits@openwebbeans.apache.org Received: (qmail 59726 invoked by uid 99); 28 Sep 2014 09:12:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2014 09:12:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2014 09:12:10 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1C1F12388993; Sun, 28 Sep 2014 09:12:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@openwebbeans.apache.org From: struberg@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140928091209.1C1F12388993@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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> classes = new ArrayList>(); + 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;