[webbeans-commits] Webbeans SVN: r2175 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Tue Mar 24 02:21:35 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-03-24 02:21:34 -0400 (Tue, 24 Mar 2009)
New Revision: 2175

Modified:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
Log:
tests for 4.2.bbb and 4.2.bbd

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java	2009-03-24 06:08:18 UTC (rev 2174)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java	2009-03-24 06:21:34 UTC (rev 2175)
@@ -208,4 +208,42 @@
       }.run();
       assert OrderProcessor.postConstructCalled;
    }   
+   
+   @Test(groups = "ri-broken")
+   @SpecAssertion(section = "4.2", id = "bbb")
+   public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
+   {
+      OrderProcessor.preDestroyCalled = false;
+      assert getCurrentManager().resolveByType(DirectOrderProcessorLocal.class).size() == 1;
+      new RunInDependentContext()
+      {
+         @Override
+         protected void execute() throws Exception
+         {  
+            Bean<DirectOrderProcessorLocal> bean = getCurrentManager().resolveByType(DirectOrderProcessorLocal.class).iterator().next();
+            DirectOrderProcessorLocal instance = getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class);
+            bean.destroy(instance);
+         }
+      }.run();
+      assert OrderProcessor.preDestroyCalled;
+   }
+   
+   @Test(groups = "ri-broken")
+   @SpecAssertion(section = "4.2", id = "bbd")
+   public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
+   {
+      OrderProcessor.preDestroyCalled = false;
+      assert getCurrentManager().resolveByType(IndirectOrderProcessor.class).size() == 1;
+      new RunInDependentContext()
+      {
+         @Override
+         protected void execute() throws Exception
+         {  
+            Bean<IndirectOrderProcessor> bean = getCurrentManager().resolveByType(IndirectOrderProcessor.class).iterator().next();
+            IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
+            bean.destroy(instance);
+         }
+      }.run();
+      assert OrderProcessor.preDestroyCalled;
+   }     
 }




More information about the weld-commits mailing list