[webbeans-commits] Webbeans SVN: r3367 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/passivating/broken19 and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Thu Jul 30 07:46:25 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-07-30 07:46:25 -0400 (Thu, 30 Jul 2009)
New Revision: 3367

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java
Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
   tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
passivation tests


Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java	2009-07-30 11:14:38 UTC (rev 3366)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java	2009-07-30 11:46:25 UTC (rev 3367)
@@ -55,6 +55,14 @@
       assert !beans.isEmpty();
    }   
    
+   @Test(groups = { "contexts", "passivation" })
+   @SpecAssertion(section = "6.6.1", id = "ca")
+   public void testPassivationCapableProducerMethodIsOK()
+   {
+      Set<Bean<Record>> beans = getBeans(Record.class);
+      assert !beans.isEmpty();
+   }
+   
    @Test @SpecAssertion(section="6.6.2", id = "c")
    public void testInjectionOfDependentPrimitiveProductIntoNormalBean()
    {

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/Record.java	2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import java.io.Serializable;
+
+ at SuppressWarnings("serial")
+class Record implements Serializable
+{
+
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/RecordProducer.java	2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+
+public class RecordProducer
+{
+   public @Produces @SessionScoped Record getRecord()
+   {
+      return new Record();
+   }
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/Broken_Record.java	2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken19;
+
+class Broken_Record
+{
+   public Broken_Record(String foo) {}
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/NonPassivationCapableProducerMethodTest.java	2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,28 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken19;
+
+import org.jboss.jsr299.tck.DeploymentError;
+import org.jboss.test.audit.annotations.SpecAssertion;
+import org.jboss.test.audit.annotations.SpecVersion;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author Shane Bryzak
+ */
+ at Artifact
+ at Packaging(PackagingType.EAR)
+ at SpecVersion("20090625")
+ at ExpectedDeploymentException(DeploymentError.class)
+public class NonPassivationCapableProducerMethodTest
+{
+   @Test(groups = { "passivation", "ri-broken" })
+   @SpecAssertion(section = "6.6.1", id = "cb")
+   public void testNonPassivationCapableProducerMethodNotOk()
+   {
+      assert false;
+   }
+}

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken19/RecordProducer.java	2009-07-30 11:46:25 UTC (rev 3367)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.context.passivating.broken19;
+
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Produces;
+
+class RecordProducer
+{
+   public final @Produces @SessionScoped Broken_Record getRecord()
+   {
+      return new Broken_Record(null);
+   }
+}

Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml	2009-07-30 11:14:38 UTC (rev 3366)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml	2009-07-30 11:46:25 UTC (rev 3367)
@@ -2708,23 +2708,31 @@
         <text>Tests with a serializable decorator.</text>
       </assertion>
     </group>
-
-    <assertion id="ca">
-      <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. _A producer method with a return type that implements or extends serializable is passivation capable_. A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable.</text>
-    </assertion>
+
+    <group>
+      <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a return type that implements or extends serializable is passivation capable. A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable.</text>
+          
+      <assertion id="ca">
+        <text>Test that a producer method with a serializable return type is passivation capable.</text>
+      </assertion>
+      
+      <assertion id="cb">
+        <text>Test that a producer method with a final, non-serializable return type is not passivation capable.</text>
+      </assertion>
+    </group>
+
+    <group>
+      <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a type that implements or extends |Serializable| is passivation capable. A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable.</text>
     
-    <assertion id="cb">
-      <text>A producer method is passivation capable if and only if it never returns a value which is not passivation capable at runtime. A producer method with a return type that implements or extends serializable is passivation capable. _A producer method with a return type that is declared final and does not implement |Serializable| is not passivation capable._</text>
-    </assertion>
+      <assertion id="da">
+        <text>Test that a producer field with a serializable type is passivation capable.</text>
+      </assertion>
+      
+      <assertion id="db">
+        <text>Test that a producer field with a final, non-serializable type is not passivation capable.</text>
+      </assertion>
+    </group>
 
-    <assertion id="da">
-      <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. _A producer field with a type that implements or extends |Serializable| is passivation capable._ A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable.</text>
-    </assertion>
-    
-    <assertion id="db">
-      <text>A producer field is passivation capable if and only if it never refers to a value which is not passivation capable at runtime. A producer field with a type that implements or extends |Serializable| is passivation capable. _A producer field with a type that is declared |final| and does not implement |Serializable| is not passivation capable._</text>
-    </assertion>
-
     <assertion id="ea">
       <text>A custom implementation of Bean is passivation capable if it implements the interface |PassivationCapable|.</text>
     </assertion>




More information about the weld-commits mailing list