[weld-commits] Weld SVN: r6139 - in cdi-tck/branches/1.0: impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent and 7 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Apr 21 09:29:35 EDT 2010


Author: dallen6
Date: 2010-04-21 09:29:32 -0400 (Wed, 21 Apr 2010)
New Revision: 6139

Modified:
   cdi-tck/branches/1.0/doc/reference/en-US/Book_Preface.xml
   cdi-tck/branches/1.0/doc/reference/en-US/appeals-process.xml
   cdi-tck/branches/1.0/doc/reference/en-US/introduction.xml
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
Log:
CDITCK-120 CDITCK-143 CDITCK-134 CDITCK-121 CDITCK-119

Modified: cdi-tck/branches/1.0/doc/reference/en-US/Book_Preface.xml
===================================================================
--- cdi-tck/branches/1.0/doc/reference/en-US/Book_Preface.xml	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/doc/reference/en-US/Book_Preface.xml	2010-04-21 13:29:32 UTC (rev 6139)
@@ -12,8 +12,8 @@
    <para>
       The CDI TCK is built atop the JBoss Test Harness, a portable and
       configurable automated test suite for authoring unit and integration tests
-      in a Java EE environment. The CDI TCK 1.0.0 uses the JBoss Test Harness
-      version 1.0.0 to execute the test suite.
+      in a Java EE environment. The CDI TCK 1.0.2CR1 uses the JBoss Test Harness
+      version 1.1.0CR6 to execute the test suite.
    </para>
 
    <para>

Modified: cdi-tck/branches/1.0/doc/reference/en-US/appeals-process.xml
===================================================================
--- cdi-tck/branches/1.0/doc/reference/en-US/appeals-process.xml	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/doc/reference/en-US/appeals-process.xml	2010-04-21 13:29:32 UTC (rev 6139)
@@ -80,7 +80,7 @@
          Project Lead, as designated by Specification Lead, Red Hat Middleware
          LLC. or his/her designate. The appellant can also monitor the process
          by following the issue report filed in the <ulink
-         url="https://jira.jboss.org/jira/browse/WBTCK">WBTCK project</ulink>
+         url="https://jira.jboss.org/jira/browse/CDITCK">CDITCK project</ulink>
          of the JBoss JIRA.
       </para>
       <para>

Modified: cdi-tck/branches/1.0/doc/reference/en-US/introduction.xml
===================================================================
--- cdi-tck/branches/1.0/doc/reference/en-US/introduction.xml	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/doc/reference/en-US/introduction.xml	2010-04-21 13:29:32 UTC (rev 6139)
@@ -173,7 +173,7 @@
             <listitem>
                <para>
                   <emphasis role="bold">JBoss Test Harness</emphasis>
-                  - The CDI TCK requires version 1.1.0-CR3 of the JBoss Test
+                  - The CDI TCK requires version 1.0.0 of the JBoss Test
                   Harness. The Harness is based on TestNG 5.x 
                   (<ulink url="http://testng.org">http://testng.org</ulink>).
                   You can read more about the harness in
@@ -235,7 +235,7 @@
             </listitem>
             <listitem>
                <para>
-                  <emphasis role="bold">TestNG 5.9</emphasis>, the testing
+                  <emphasis role="bold">TestNG 5.10</emphasis>, the testing
                   framework on which the JBoss Test Harness is based and which
                   provides the extension points for selecting an executing the
                   tests in the test suite.

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -411,16 +411,14 @@
       Bean<Interior> roomBean = getBeans(Interior.class, new RoomBinding()).iterator().next();
       
       CreationalContext<Interior> roomCreationalContext = getCurrentManager().createCreationalContext(roomBean);
+      Interior room = (Interior) getCurrentManager().getReference(roomBean, Interior.class, roomCreationalContext);
       
-      Interior room = roomBean.create(roomCreationalContext);
-      
       InteriorDecorator.reset();
       
       room.foo();
       
       assert InteriorDecorator.getInstances().size() == 1;
-      
-      roomBean.destroy(room, roomCreationalContext);
+      roomCreationalContext.release();
       assert InteriorDecorator.isDestroyed();
    }
    
@@ -434,12 +432,12 @@
       Bean<AccountTransaction> bean = getBeans(AccountTransaction.class).iterator().next();
       CreationalContext<AccountTransaction> ctx = getCurrentManager().createCreationalContext(bean);
             
-      AccountTransaction trans = bean.create(ctx);
+      AccountTransaction trans = (AccountTransaction) getCurrentManager().getReference(bean, AccountTransaction.class, ctx);
       trans.execute();
       
       assert TransactionalInterceptor.intercepted;
       
-      bean.destroy(trans, ctx);
+      ctx.release();
       
       assert TransactionalInterceptor.destroyed;      
    }

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/CityDecorator.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -23,10 +23,10 @@
 import javax.enterprise.inject.Any;
 import javax.inject.Inject;
 
- at SuppressWarnings("serial")
 @Decorator
 public class CityDecorator implements CityInterface, Serializable
 {
+   private static final long serialVersionUID = 7666849923138796340L;
    @Inject @Delegate @Any CityInterface city;
    
    @Inject

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingBeanConstructor/UnderwaterCity.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -18,9 +18,14 @@
 
 import java.io.Serializable;
 
+import javax.enterprise.context.SessionScoped;
+
+ at SessionScoped
 class UnderwaterCity implements CityInterface, Serializable
 {
 
+   private static final long serialVersionUID = 3226222322140685248L;
+
    public void foo()
    {
       

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInitializerMethod/UnderwaterCity.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -24,6 +24,8 @@
 class UnderwaterCity implements CityInterface, Serializable
 {
 
+   private static final long serialVersionUID = 7753204334538945451L;
+
    public void foo()
    {
       

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/broken/decoratorWithNonPassivatingInjectedField/UnderwaterCity.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -18,9 +18,14 @@
 
 import java.io.Serializable;
 
+import javax.enterprise.context.SessionScoped;
+
+ at SessionScoped
 class UnderwaterCity implements CityInterface, Serializable
 {
 
+   private static final long serialVersionUID = 1877770475170392128L;
+
    public void foo()
    {
       

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/session/IntrospectSession.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 
-import javax.enterprise.inject.spi.BeanManager;
 import javax.inject.Inject;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
@@ -36,14 +35,12 @@
 {
    private static final long serialVersionUID = 1L;
 
-   @Inject
-   private BeanManager jsr299Manager;
+   @Inject private SimpleSessionBean aBean;
 
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
    {
       resp.setContentType("text/text");
-      SimpleSessionBean aBean = org.jboss.jsr299.tck.impl.OldSPIBridge.getInstanceByType(jsr299Manager,SimpleSessionBean.class);
       resp.getWriter().print(aBean.hashCode());
    }
 

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/BeanManagerTest.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -41,7 +41,6 @@
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.PassivationCapable;
 import javax.enterprise.util.AnnotationLiteral;
 import javax.interceptor.InterceptorBinding;
 
@@ -49,9 +48,9 @@
 import org.jboss.jsr299.tck.literals.RetentionLiteral;
 import org.jboss.jsr299.tck.literals.TargetLiteral;
 import org.jboss.test.audit.annotations.SpecAssertion;
-import org.jboss.test.audit.annotations.SpecAssertions;
 import org.jboss.test.audit.annotations.SpecVersion;
 import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.jsr299.Extension;
 import org.testng.annotations.Test;
 
 /**
@@ -62,21 +61,11 @@
  *
  */
 @Artifact
+ at Extension("javax.enterprise.inject.spi.Extension")
 @SpecVersion(spec="cdi", version="20091101")
 public class BeanManagerTest extends AbstractJSR299Test
 {
    @Test
-   @SpecAssertion(section = "11.3.6", id = "a")
-   public void testGetPassivationCapableBeanById()
-   {
-      Bean<?> bean = getCurrentManager().getBeans(Cow.class).iterator().next();
-      assert PassivationCapable.class.isAssignableFrom(bean.getClass());
-      PassivationCapable passivationCapable = (PassivationCapable) bean;
-      Bean<?> passivatingBean = getCurrentManager().getPassivationCapableBean(passivationCapable.getId());
-      assert bean == passivatingBean;
-   }
-
-   @Test
    @SpecAssertion(section = "11.3.7", id = "a")
    public void testAmbiguousDependencyResolved()
    {

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/extensions/beanManager/Cow.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -18,5 +18,8 @@
 
 public class Cow
 {
-
+   public Cow(String name)
+   {
+      
+   }
 }

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -134,8 +134,10 @@
       final Contextual<ShoeFactory> bean = getBeans(ShoeFactory.class).iterator().next();
       MockCreationalContext.reset();
       ShoeFactory instance = getCurrentManager().getContext(Dependent.class).get(bean, creationalContext);
-      assert MockCreationalContext.isPushCalled();
-      assert instance == MockCreationalContext.getLastBeanPushed();
+      if (MockCreationalContext.isPushCalled())
+      {
+         assert instance == MockCreationalContext.getLastBeanPushed();
+      }
    }
    
    @Test(groups = "beanLifecycle")
@@ -149,8 +151,6 @@
       final Contextual<FishPond> bean = getBeans(FishPond.class).iterator().next();
       FishPond fishPond = bean.create(creationalContext);
       assert fishPond != null;
-      assert MockCreationalContext.isPushCalled();
-      assert MockCreationalContext.getBeansPushed().contains(fishPond);
       assert fishPond.goldfish != null;
       assert fishPond.goldfish instanceof Goldfish;
       assert fishPond.goose != null;
@@ -179,8 +179,7 @@
       @SpecAssertion(section = "7.3.1", id = "aa"),
       @SpecAssertion(section = "3.8.1", id = "aa"),
       @SpecAssertion(section="2.3.4", id="a"),
-      @SpecAssertion(section="3.8", id="aa"),
-      @SpecAssertion(section="3.8", id="ab"),
+      @SpecAssertion(section="3.8", id="a"),
       @SpecAssertion(section="12.1", id="bca")
    })
    public void testCreateInjectsFieldsDeclaredInJava()

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/CircularDependencyTest.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,7 +9,7 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
@@ -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/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Food.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,14 +9,13 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 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/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java	2010-04-21 13:14:29 UTC (rev 6138)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/circular/Pig.java	2010-04-21 13:29:32 UTC (rev 6139)
@@ -9,42 +9,33 @@
  * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an "AS IS" BASIS,  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.jboss.jsr299.tck.tests.lookup.circular;
 
-import javax.annotation.PostConstruct;
-import javax.enterprise.context.ApplicationScoped;
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
 import javax.inject.Inject;
 
- at ApplicationScoped
-class Pig
+ at SessionScoped
+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