Author: pete.muir(a)jboss.org
Date: 2009-01-29 11:16:59 -0500 (Thu, 29 Jan 2009)
New Revision: 1289
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Farm.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Horse.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Stable.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/DependentContextTest.java
Log:
broken test for dependent object destruction
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/DependentContextTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/DependentContextTest.java 2009-01-29
15:55:29 UTC (rev 1288)
+++
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/DependentContextTest.java 2009-01-29
16:16:59 UTC (rev 1289)
@@ -535,11 +535,19 @@
* destroy all dependent objects of a Web Bean instance when the instance is
* destroyed,
*/
- @Test(groups = { "stub", "contexts", "beanDestruction"
})
+ @Test(groups = { "broken", "contexts", "beanDestruction"
})
@SpecAssertion(section = "8.3.2")
public void testDestroyingParentDestroysDependents()
{
- assert false;
+ deployBeans(Farm.class, Horse.class, Stable.class);
+ assert manager.resolveByType(Farm.class).size() == 1;
+ Bean<Farm> farmBean = manager.resolveByType(Farm.class).iterator().next();
+ Farm farm = manager.getInstanceByType(Farm.class);
+ Stable.destroyed = false;
+ Horse.destroyed = false;
+ farmBean.destroy(farm);
+ assert Stable.destroyed;
+ assert Horse.destroyed;
}
/**
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Farm.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Farm.java 2009-01-29
16:16:59 UTC (rev 1289)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.tck.unit.context.dependent;
+
+import javax.context.RequestScoped;
+import javax.inject.Current;
+
+@RequestScoped
+public class Farm
+{
+
+ @Current Stable stable;
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Farm.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Horse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Horse.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Horse.java 2009-01-29
16:16:59 UTC (rev 1289)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.tck.unit.context.dependent;
+
+import javax.annotation.PreDestroy;
+
+class Horse
+{
+
+ public static boolean destroyed;
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ destroyed = true;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Horse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Stable.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Stable.java
(rev 0)
+++
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Stable.java 2009-01-29
16:16:59 UTC (rev 1289)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.tck.unit.context.dependent;
+
+import javax.annotation.PreDestroy;
+import javax.inject.Current;
+
+class Stable
+{
+
+ @Current Horse horse;
+
+ public static boolean destroyed;
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ destroyed = true;
+ }
+
+}
Property changes on:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/context/dependent/Stable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Show replies by date