[weld-commits] Weld SVN: r6126 - cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Tue Apr 20 12:50:24 EDT 2010
Author: dallen6
Date: 2010-04-20 12:50:22 -0400 (Tue, 20 Apr 2010)
New Revision: 6126
Modified:
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
Log:
CDITCK-140 Removed the PostConstruct methods and check circular deps after bean instances created
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java 2010-04-20 16:11:40 UTC (rev 6125)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java 2010-04-20 16:50:22 UTC (rev 6126)
@@ -31,9 +31,10 @@
@SpecAssertion(section="5", id="b")
public void testCircularInjectionOnTwoNormalBeans() throws Exception
{
- getInstanceByType(Pig.class).getName();
- assert Pig.success;
- assert Food.success;
+ Pig pig = getInstanceByType(Pig.class);
+ Food food = getInstanceByType(Food.class);
+ assert pig.getNameOfFood().equals(food.getName());
+ assert food.getNameOfPig().equals(pig.getName());
}
@Test
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java 2010-04-20 16:11:40 UTC (rev 6125)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java 2010-04-20 16:50:22 UTC (rev 6126)
@@ -16,7 +16,6 @@
*/
package org.jboss.jsr299.tck.tests.lookup.circular;
-import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@@ -24,27 +23,15 @@
class Food
{
- public static boolean success;
-
@Inject Pig pig;
- public Food()
- {
- success = false;
- }
-
- @PostConstruct
- public void postConstruct()
- {
- if (pig.getName().equals("john"))
- {
- success = true;
- }
- }
-
public String getName()
{
return "food";
}
+ public String getNameOfPig()
+ {
+ return pig.getName();
+ }
}
Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java 2010-04-20 16:11:40 UTC (rev 6125)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java 2010-04-20 16:50:22 UTC (rev 6126)
@@ -16,35 +16,26 @@
*/
package org.jboss.jsr299.tck.tests.lookup.circular;
-import javax.annotation.PostConstruct;
+import java.io.Serializable;
+
import javax.enterprise.context.SessionScoped;
import javax.inject.Inject;
@SessionScoped
-class Pig
+class Pig implements Serializable
{
- public static boolean success;
-
+ private static final long serialVersionUID = 2445308247858178311L;
+
@Inject Food food;
- public Pig()
- {
- success = false;
- }
-
- @PostConstruct
- public void postConstruct()
- {
- if (food.getName().equals("food"))
- {
- success = true;
- }
- }
-
public String getName()
{
return "john";
}
+ public String getNameOfFood()
+ {
+ return food.getName();
+ }
}
More information about the weld-commits
mailing list