[webbeans-commits] Webbeans SVN: r3421 - in tck/trunk/impl/src/main: resources/org/jboss/jsr299/tck/tests/context/dependent and 1 other directory.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Aug 10 10:51:28 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-08-10 10:51:28 -0400 (Mon, 10 Aug 2009)
New Revision: 3421
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/dependent/beans.xml
Log:
ALter test to not depend on ambiguous behavior in the spec
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-10 14:33:00 UTC (rev 3420)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-08-10 14:51:28 UTC (rev 3421)
@@ -347,7 +347,7 @@
assert HorseStable.isDestroyed();
}
- @Test(groups = { "contexts", "broken" })
+ @Test(groups = { "contexts" })
@SpecAssertion(section = "6.4.1", id = "ab")
public void testDependentScopedDecoratorsAreDependentObjectsOfBean()
{
@@ -360,16 +360,14 @@
Interior room = roomBean.create(roomCreationalContext);
Interior hallway = hallwayBean.create(hallwayCreationalContext);
- InteriorDecorator.instances.clear();
+ InteriorDecorator.reset();
room.foo();
- assert InteriorDecorator.instances.size() > 0;
- assert InteriorDecorator.instances.size() == 1;
+ assert InteriorDecorator.getInstances().size() > 0;
+ assert InteriorDecorator.getInstances().size() == 1;
+ roomBean.destroy(room, roomCreationalContext);
+ assert InteriorDecorator.isDestroyed();
- hallway.foo();
-
- assert InteriorDecorator.instances.size() == 2;
- assert !InteriorDecorator.instances.get(0).equals(InteriorDecorator.instances.get(1));
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java 2009-08-10 14:33:00 UTC (rev 3420)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/InteriorDecorator.java 2009-08-10 14:51:28 UTC (rev 3421)
@@ -3,20 +3,51 @@
import java.util.ArrayList;
import java.util.List;
+import javax.annotation.PreDestroy;
import javax.decorator.Decorates;
import javax.decorator.Decorator;
@Decorator
class InteriorDecorator
{
- @Decorates Interior interior;
+ @Decorates @Room Interior interior;
- public static List<InteriorDecorator> instances = new ArrayList<InteriorDecorator>();
+ private static List<InteriorDecorator> instances = new ArrayList<InteriorDecorator>();
+ private static boolean destroyed;
+
+ public static void reset()
+ {
+ instances.clear();
+ destroyed = false;
+ }
+
public void foo()
{
instances.add(this);
interior.foo();
}
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ destroyed = true;
+ }
+
+ /**
+ * @return the instances
+ */
+ public static List<InteriorDecorator> getInstances()
+ {
+ return instances;
+ }
+
+ /**
+ * @return the destroyed
+ */
+ public static boolean isDestroyed()
+ {
+ return destroyed;
+ }
}
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/dependent/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/dependent/beans.xml 2009-08-10 14:33:00 UTC (rev 3420)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/dependent/beans.xml 2009-08-10 14:51:28 UTC (rev 3421)
@@ -1,3 +1,6 @@
<beans>
+ <decorators>
+ <decorator>org.jboss.jsr299.tck.tests.context.dependent.InteriorDecorator</decorator>
+ </decorators>
</beans>
More information about the weld-commits
mailing list