[weld-commits] Weld SVN: r7124 - cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Fri Dec 10 10:10:13 EST 2010


Author: pete.muir at jboss.org
Date: 2010-12-10 10:10:12 -0500 (Fri, 10 Dec 2010)
New Revision: 7124

Modified:
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java
   cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ManualCidPropagationTest.java
Log:
CDITCK-191

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java	2010-12-09 13:48:50 UTC (rev 7123)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ClientConversationContextTest.java	2010-12-10 15:10:12 UTC (rev 7124)
@@ -63,13 +63,13 @@
    public void testConversationIdSetByContainerIsUnique() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage storm = client.getPage(getPath("/storm.jsf"));
+      HtmlPage storm = client.getPage(getPath("storm.jsf"));
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
       storm = beginConversationButton.click();
       
       String c1 = getCid(storm);
       
-      storm = client.getPage(getPath("/storm.jsf"));
+      storm = client.getPage(getPath("storm.jsf"));
       beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
       storm = beginConversationButton.click();
       
@@ -85,7 +85,7 @@
    {
       WebClient client = new WebClient();
       resetCloud(client);
-      HtmlPage page = client.getPage(getPath("/cloud.jsf"));
+      HtmlPage page = client.getPage(getPath("cloud.jsf"));
       assert !isLongRunning(page);
       assert isCloudDestroyed(client);
    }
@@ -95,13 +95,13 @@
    public void testLongRunningConversationInstancesNotDestroyedAtRequestEnd() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage storm = client.getPage(getPath("/storm.jsf"));
+      HtmlPage storm = client.getPage(getPath("storm.jsf"));
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
       storm = beginConversationButton.click();
       
       resetCloud(client);
       
-      client.getPage(getPath("/cloud.jsf", getCid(storm)));
+      client.getPage(getPath("cloud.jsf", getCid(storm)));
       assert !isCloudDestroyed(client);
    }
    
@@ -112,7 +112,7 @@
       WebClient client = new WebClient();
       client.setThrowExceptionOnFailingStatusCode(false);
       // Load the page
-      HtmlPage rain = client.getPage(getPath("/rain.jsf"));
+      HtmlPage rain = client.getPage(getPath("rain.jsf"));
       
       // begin a conversation
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "beginConversationButton");
@@ -124,14 +124,14 @@
       rain = rainButton.click();
       
       // Re-request the page, inside the conversation and check it has rained
-      rain = client.getPage(getPath("/rain.jsf", cid));
+      rain = client.getPage(getPath("rain.jsf", cid));
       assert hasRained(rain);
       
       // Invalidate the session, invalidate the conversation-scoped cloud
       invalidateSession(client);
       
       // Re-request the page, check it hasn't rained
-      rain = client.getPage(getPath("/rain.jsf", cid));
+      rain = client.getPage(getPath("rain.jsf", cid));
       assert !hasRained(rain);
    }
    
@@ -142,7 +142,7 @@
       WebClient client = new WebClient();
       
       // Load the page
-      HtmlPage rain = client.getPage(getPath("/rain.jsf"));
+      HtmlPage rain = client.getPage(getPath("rain.jsf"));
       
       // begin a conversation
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(rain, HtmlSubmitInput.class, "beginConversationButton");
@@ -154,13 +154,13 @@
       rain = rainButton.click();
       
       // Re-request the page, inside the conversation and check it has rained
-      rain = client.getPage(getPath("/rain.jsf", cid));
+      rain = client.getPage(getPath("rain.jsf", cid));
       assert hasRained(rain);
       
       // Create a new web client and load the page
       WebClient client2 = new WebClient();
       client2.setThrowExceptionOnFailingStatusCode(false);
-      rain = client2.getPage(getPath("/rain.jsf", cid));
+      rain = client2.getPage(getPath("rain.jsf", cid));
       assert !hasRained(rain);
    }
    
@@ -169,7 +169,7 @@
    public void testConversationActiveDuringNonFacesRequest() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cloud.jsf"));
+      HtmlPage page = client.getPage(getPath("cloud.jsf"));
       HtmlSpan span = getFirstMatchingElement(page, HtmlSpan.class, "cloudName");
       assert span.getTextContent().equals(Cloud.NAME);
    }
@@ -179,7 +179,7 @@
    public void testConversationBeginMakesConversationLongRunning() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // begin a conversation
@@ -193,7 +193,7 @@
    public void testBeginAlreadyLongRunningConversationThrowsException() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // begin a conversation
@@ -216,7 +216,7 @@
    public void testConversationEndMakesConversationTransient() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // begin a conversation
@@ -235,7 +235,7 @@
    public void testEndTransientConversationThrowsException() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // try ending a transient conversation
@@ -252,7 +252,7 @@
    public void testBeanWithRequestScope() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/builtin.jsf"));
+      HtmlPage page = client.getPage(getPath("builtin.jsf"));
       assert page.getBody().getTextContent().contains("Correct scope: true");
    }
    
@@ -261,7 +261,7 @@
    public void testBeanWithDefaultQualifier() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/builtin.jsf"));
+      HtmlPage page = client.getPage(getPath("builtin.jsf"));
       assert page.getBody().getTextContent().contains("Correct qualifier: true");
    }
    
@@ -270,7 +270,7 @@
    public void testBeanWithNameJavaxEnterpriseContextConversation() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/builtin.jsf"));
+      HtmlPage page = client.getPage(getPath("builtin.jsf"));
       assert page.getBody().getTextContent().contains("Correct name: true");
    }
    
@@ -282,7 +282,7 @@
    public void testTransientConversationHasNullId() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/builtin.jsf"));
+      HtmlPage page = client.getPage(getPath("builtin.jsf"));
       assert page.getBody().getTextContent().contains("Default conversation has null id: true");
    }
    
@@ -294,7 +294,7 @@
    public void testConversationIdMayBeSetByApplication() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // begin a conversation
@@ -313,7 +313,7 @@
    public void testConversationIdMayBeSetByContainer() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // begin a conversation
@@ -324,6 +324,17 @@
       assert page.getBody().getTextContent().contains("Cumulus congestus");
    }
    
+   @Test(groups = { "contexts" })
+   @SpecAssertion(section = "6.7.4", id = "tb")
+   public void testNonexistentConversationExceptionThrown() throws Exception
+   {
+      WebClient client = new WebClient();
+      HtmlPage page = client.getPage(getPath("cumulus.jsf?cid=foo"));
+      
+      assert page.getBody().getTextContent().contains("NonexistentConversationException thrown properly");
+      assert page.getBody().getTextContent().contains("Conversation.isTransient: true");
+   }
+   
    @Test
    @SpecAssertions({
       @SpecAssertion(section = "6.7.5", id = "m"),
@@ -332,7 +343,7 @@
    public void testSetConversationTimeoutOverride() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
    
       // begin a conversation and set a custom timeout
@@ -346,7 +357,7 @@
    public void testConversationHasDefaultTimeout() throws Exception
    {
       WebClient client = new WebClient();
-      HtmlPage page = client.getPage(getPath("/cumulus.jsf"));
+      HtmlPage page = client.getPage(getPath("cumulus.jsf"));
       assert !isLongRunning(page);
       
       // begin a conversation

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java	2010-12-09 13:48:50 UTC (rev 7123)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/InvalidatingSessionDestroysConversationTest.java	2010-12-10 15:10:12 UTC (rev 7124)
@@ -51,7 +51,7 @@
    {
       WebClient webClient = new WebClient();
       resetCloud(webClient);
-      webClient.getPage(getPath("/clouds.jsf"));
+      webClient.getPage(getPath("clouds.jsf"));
       assert !isCloudDestroyed(webClient);
       invalidateSession(webClient);
       assert isCloudDestroyed(webClient);

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java	2010-12-09 13:48:50 UTC (rev 7123)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/LongRunningConversationPropagatedByFacesContextTest.java	2010-12-10 15:10:12 UTC (rev 7124)
@@ -61,7 +61,7 @@
    public void testConversationPropagated() throws Exception
    {
       WebClient webClient = new WebClient();
-      HtmlPage storm = webClient.getPage(getPath("/storm.jsf"));
+      HtmlPage storm = webClient.getPage(getPath("storm.jsf"));
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
       storm = beginConversationButton.click();
       HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");
@@ -79,7 +79,7 @@
    public void testConversationPropagatedOverRedirect() throws Exception
    {
       WebClient webClient = new WebClient();
-      HtmlPage storm = webClient.getPage(getPath("/storm.jsf"));
+      HtmlPage storm = webClient.getPage(getPath("storm.jsf"));
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
       storm = beginConversationButton.click();
       HtmlTextInput stormStrength = getFirstMatchingElement(storm, HtmlTextInput.class, "stormStrength");

Modified: cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ManualCidPropagationTest.java
===================================================================
--- cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ManualCidPropagationTest.java	2010-12-09 13:48:50 UTC (rev 7123)
+++ cdi-tck/branches/1.0/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/ManualCidPropagationTest.java	2010-12-10 15:10:12 UTC (rev 7124)
@@ -54,13 +54,13 @@
    public void testManualCidPropagation() throws Exception
    {
       WebClient webClient = new WebClient();
-      HtmlPage storm = webClient.getPage(getPath("/storm.jsf"));
+      HtmlPage storm = webClient.getPage(getPath("storm.jsf"));
       HtmlSubmitInput beginConversationButton = getFirstMatchingElement(storm, HtmlSubmitInput.class, "beginConversationButton");
       storm = beginConversationButton.click();
       
       String c1 = getCid(storm);
       
-      HtmlPage cloud = webClient.getPage(getPath("/cloud.jsf", c1));
+      HtmlPage cloud = webClient.getPage(getPath("cloud.jsf", c1));
       
       String c2 = getCid(cloud);
       



More information about the weld-commits mailing list