[webbeans-commits] Webbeans SVN: r3216 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation and 1 other directory.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sat Jul 25 10:38:28 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-07-25 10:38:27 -0400 (Sat, 25 Jul 2009)
New Revision: 3216

Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java
Log:
Fix RI conversation.getId() when conversation is transient

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java	2009-07-25 13:16:47 UTC (rev 3215)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java	2009-07-25 14:38:27 UTC (rev 3216)
@@ -22,7 +22,6 @@
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.Initializer;
 import javax.enterprise.inject.Named;
-import javax.enterprise.inject.deployment.Standard;
 
 import org.jboss.webbeans.log.LogProvider;
 import org.jboss.webbeans.log.Logging;
@@ -35,7 +34,6 @@
  */
 @RequestScoped
 @Named("javax.enterprise.context.conversation")
- at Standard
 public class ConversationImpl implements Conversation, Serializable
 {
 
@@ -118,12 +116,19 @@
          throw new IllegalStateException("Attempt to call end() on a transient conversation");
       }
       log.debug("Demoted conversation " + cid + " to transient");
-      longRunning = false;
+      this.longRunning = false;
    }
 
    public String getId()
    {
-      return cid;
+      if (isLongRunning())
+      {
+         return cid;
+      }
+      else
+      {
+         return null;
+      }
    }
 
    public long getTimeout()

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java	2009-07-25 13:16:47 UTC (rev 3215)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationContextTest.java	2009-07-25 14:38:27 UTC (rev 3216)
@@ -5,7 +5,6 @@
 import javax.enterprise.context.Conversation;
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.inject.Current;
-import javax.enterprise.inject.deployment.Standard;
 
 import org.hibernate.tck.annotations.SpecAssertion;
 import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -58,6 +57,15 @@
    }
    
    @Test(groups = { "contexts" })
+   @SpecAssertion(section = "6.7.5", id = "l")
+   public void testTransientConversationHasNullId()
+   {
+      Conversation conversation = getInstanceByType(Conversation.class);
+      assert !conversation.isLongRunning();
+      assert conversation.getId() == null;
+   }
+   
+   @Test(groups = { "contexts" })
    @SpecAssertion(section = "6.7.5", id = "ie")
    public void testBeanWithNameJavaxEnterpriseContextConversation()
    {

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java	2009-07-25 13:16:47 UTC (rev 3215)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ConversationIdSetByApplicationTest.java	2009-07-25 14:38:27 UTC (rev 3216)
@@ -16,26 +16,7 @@
 @Artifact
 public class ConversationIdSetByApplicationTest extends AbstractJSR299Test
 {
-   @Override
-   public void beforeMethod()
-   {
-      super.beforeMethod();
-      Conversation conversation = getInstanceByType(Conversation.class);
-      if (conversation.isLongRunning())
-      {
-         conversation.end();
-      }
-   }
    
-   @Test(groups = { "contexts", "ri-broken" })
-   @SpecAssertion(section = "6.7.5", id = "l")
-   public void testTransientConversationHasNullId()
-   {
-      Conversation conversation = getInstanceByType(Conversation.class);
-      assert !conversation.isLongRunning();
-      assert conversation.getId() == null;
-   }
-   
    @Test(groups = { "contexts" })
    @SpecAssertions({
       @SpecAssertion(section = "6.7.4", id = "ha"),




More information about the weld-commits mailing list