openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r908507 - /openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
Date Wed, 10 Feb 2010 14:05:35 GMT
Author: struberg
Date: Wed Feb 10 14:05:34 2010
New Revision: 908507

URL: http://svn.apache.org/viewvc?rev=908507&view=rev
Log:
OWB-6 tests for  improved passivation scope checks

Modified:
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java?rev=908507&r1=908506&r2=908507&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/newtests/portable/ExtensionTest.java
Wed Feb 10 14:05:34 2010
@@ -28,11 +28,13 @@
 
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.exception.inject.DefinitionException;
 import org.apache.webbeans.lifecycle.test.MockServletContext;
 import org.apache.webbeans.newtests.AbstractUnitTest;
 import org.apache.webbeans.newtests.portable.scopeextension.ExternalTestScopeExtension;
 import org.apache.webbeans.newtests.portable.scopeextension.ExternalTestScoped;
 import org.apache.webbeans.newtests.portable.scopeextension.ExternalTestScopedBean;
+import org.apache.webbeans.newtests.portable.scopeextension.ExternalUnserializableTestScopedBean;
 import org.apache.webbeans.portable.events.discovery.BeforeShutdownImpl;
 import org.junit.Test;
 
@@ -78,4 +80,25 @@
         ContextFactory.destroyApplicationContext(servletContext);
     }
     
+    /**
+     * Classes in a passivatable scope must be Serializable
+     */
+    @Test
+    public void testUnserializableBean() 
+    {
+        try 
+        {
+            Collection<Class<?>> classes = new ArrayList<Class<?>>();
+            classes.add(ExternalUnserializableTestScopedBean.class);
+            addExtension(new ExternalTestScopeExtension());
+            startContainer(classes);
+            
+            // we must not get here since an Exception is expected!
+            Assert.fail();
+        }
+        catch (DefinitionException dex)
+        {
+            // this is expected!
+        }
+    }
 }



Mime
View raw message