[webbeans-commits] Webbeans SVN: r1980 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: producer/method/disposal/definition and 1 other directory.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Fri Mar 13 13:32:52 EDT 2009


Author: dallen6
Date: 2009-03-13 13:32:51 -0400 (Fri, 13 Mar 2009)
New Revision: 1980

Added:
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java
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/FrankfurtAmMain.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java
Log:
Finished EJB lifecycle tests that can work w/current RI

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-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -67,7 +67,7 @@
       Set<Class<?>> interfaces = new HashSet<Class<?>>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
       assert interfaces.contains(KleinStadt.class);
       assert interfaces.contains(SchoeneStadt.class);
-      frankfurt.dispose();
+      //frankfurt.dispose();
    }
 
    @Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration", "ri-broken" })
@@ -83,11 +83,12 @@
       Context requestContext = getCurrentManager().getContext(RequestScoped.class);
       CreationalContext<KleinStadt> creationalContext = new MockCreationalContext<KleinStadt>();
       KleinStadt kassel = requestContext.get(stadtBean, creationalContext);
-      kassel.zustandVergessen();
-      //assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
+      stadtBean.destroy(kassel);
+      
+      assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
       kassel = requestContext.get(stadtBean);
       assert kassel == null : "SFSB bean should not exist after being destroyed";
-      frankfurt.dispose();
+      //frankfurt.dispose();
    }
 
    @Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
@@ -159,11 +160,16 @@
       assert false;
    }
 
-   @Test(groups = { "enterpriseBeans", "lifecycle", "stub" })
+   @Test(groups = { "enterpriseBeans", "lifecycle", "ri-broken" })
    @SpecAssertion(section = "6.11", id = "f")
    public void testDependentObjectsDestroyed()
    {
-      assert false;
+      UniStadt marburg = getCurrentManager().getInstanceByType(UniStadt.class);
+      assert marburg != null : "Couldn't find the main SFSB";
+      Bean<UniStadt> uniStadtBean = getCurrentManager().resolveByType(UniStadt.class).iterator().next();
+      uniStadtBean.destroy(marburg);
+      GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
+      assert frankfurt.isSchlossDestroyed();
    }
 
 }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java	2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -47,4 +47,16 @@
    {
    }
 
+   private boolean schlossDestroyed = false;
+
+   public boolean isSchlossDestroyed()
+   {
+      return schlossDestroyed;
+   }
+
+   public void schlossDestroyed()
+   {
+      schlossDestroyed = true;
+   }
+
 }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java	2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -18,4 +18,8 @@
    public void resetDestroyedFlags();
    
    public void dispose();
+
+   public void schlossDestroyed();
+
+   public boolean isSchlossDestroyed();
 }

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.annotation.PreDestroy;
+import javax.context.Dependent;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Current;
+
+ at Stateful
+ at Dependent
+public class LandgraffenSchloss implements Schloss
+{
+   @Current
+   private GrossStadt biggerCity;
+
+   @PreDestroy
+   public void destructionCallback()
+   {
+      biggerCity.schlossDestroyed();
+   }
+
+   @Remove
+   public void remove()
+   {
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java	2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -23,8 +23,8 @@
    @PostConstruct
    public void performPostConstructChecks()
    {
-      assert placeOfInterest != null : "Injected field is missing";
-      name = placeOfInterest.getName();
+      if ( placeOfInterest != null )
+         name = placeOfInterest.getName();
    }
    
    @Initializer

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Current;
+
+ at Stateful
+public class Marburg implements UniStadt
+{
+   @Current
+   private Schloss theCastle;
+
+   @Remove
+   public void removeBean()
+   {
+   }
+
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+ at Local
+public interface Schloss
+{
+   public void destructionCallback();
+   
+   public void remove();
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java	                        (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+ at Local
+public interface UniStadt
+{
+   public void removeBean();
+}


Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java	2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java	2009-03-13 17:32:51 UTC (rev 1980)
@@ -22,8 +22,7 @@
    @Test(groups = { "stub", "disposalMethod" })
    @SpecAssertions({
       @SpecAssertion(section = "3.4.6", id = "a"),
-      @SpecAssertion(section = "3.4.6", id = "c"),
-      @SpecAssertion(section = "3.4.6", id = "e")
+      @SpecAssertion(section = "3.4.6", id = "c")
    })
    public void testDisposalMethodCanBeOfSimpleOrSessionBean()
    {
@@ -35,7 +34,7 @@
     */
    @Test(groups = { "stub", "disposalMethod" })
    @SpecAssertion(section = "3.4.6", id = "b")
-   public void testDisposalMethodCanBeStaticOrNonStatic()
+   public void testDisposalMethodCanBeStatic()
    {
       assert false;
    }
@@ -44,7 +43,7 @@
     * A bean may declare multiple disposal methods
     */
    @Test(groups = { "stub", "disposalMethod" })
-   @SpecAssertion(section = "3.4.6", id = "d")
+   @SpecAssertion(section = "3.4.6", id = "e")
    public void testBeanCanDeclareMultipleDisposalMethods()
    {
       assert false;




More information about the weld-commits mailing list