Author: manaRH
Date: 2013-02-19 11:05:43 -0500 (Tue, 19 Feb 2013)
New Revision: 15412
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationAction.java
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationPropagationsTest.java
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyConversationEndingException.java
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyException.java
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/conversations.xhtml
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/error.xhtml
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/home.xhtml
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/output.xhtml
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/pages.xml
Log:
ConversationPropagationsTest
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationAction.java
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationAction.java
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationAction.java 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,131 @@
+package org.jboss.seam.test.integration.faces.conversations;
+
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.faces.Redirect;
+import org.jboss.seam.international.StatusMessages;
+import org.jboss.seam.log.Log;
+
+@Name("ConversationAction")
+(a)Scope(ScopeType.CONVERSATION)
+public class ConversationAction implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+
+ @Logger
+ private Log log;
+
+ @In
+ StatusMessages statusMessages;
+
+ @Out(value = "state", scope = ScopeType.SESSION)
+ String state = "";
+
+ @Out(value = "foo", scope = ScopeType.CONVERSATION)
+ String foo = "";
+
+ @Out(value = "bar", scope = ScopeType.PAGE)
+ String bar = "";
+
+ @Begin
+ public void begin()
+ {
+ state += "begin;";
+ }
+
+ @End
+ public void end()
+ {
+ state += "end;";
+ }
+
+ public void xyzzy()
+ {
+ state += "xyzzy;";
+ }
+
+ public String viewOutput()
+ {
+
+ state += "viewOutput;";
+
+ return "output";
+ }
+
+ public String redirectOutput()
+ {
+
+ state += "redirectOutput;";
+
+ return "output?faces-redirect=true";
+ }
+
+ public void raiseException() throws MyException
+ {
+ state += "raiseException;";
+ throw new MyException();
+ }
+
+ public void raiseConversationEndingException() throws MyConversationEndingException
+ {
+ state += "raiseConversationEndingException;";
+ throw new MyConversationEndingException();
+ }
+
+ public String getState()
+ {
+ return state;
+ }
+
+ public String pagesRender()
+ {
+ state += "pagesRender;";
+
+ return "render";
+ }
+
+ public String pagesRedirect()
+ {
+ state += "pagesRedirect;";
+
+ return "redirect";
+ }
+
+ public void programmaticRedirect()
+ {
+
+ state += "programmaticRedirect;";
+
+ Redirect redirect = Redirect.instance();
+ redirect.setViewId("/output.xhtml");
+ redirect.execute();
+ }
+
+ public void programmaticRedirectNoPropagation()
+ {
+
+ state += "programmaticRedirectNoPropagation;";
+
+ Redirect redirect = Redirect.instance();
+ redirect.setConversationPropagationEnabled(false);
+ redirect.setViewId("/output.xhtml");
+ redirect.execute();
+
+ // FacesManager.instance().redirect("/output.xhtml", null, false,
false);
+ }
+
+ /*
+ @BypassInterceptors
+ public boolean equals(Object other) {
+ return super.equals(other);
+ }
+ */
+}
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationPropagationsTest.java
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationPropagationsTest.java
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/ConversationPropagationsTest.java 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,219 @@
+package org.jboss.seam.test.integration.faces.conversations;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+/**
+ * Tests various conversation propagation scenarios.
+ *
+ * @author maschmid
+ *
+ */
+(a)RunWith(Arquillian.class)
+@RunAsClient
+public class ConversationPropagationsTest
+{
+ private static String FORM_PREFIX_ID = "form:";
+
+ private static int JAVASCRIPT_WAIT = 1000;
+
+ private final WebClient client = new WebClient();
+
+ @ArquillianResource
+ URL contextPath;
+
+ @Deployment(name = "ConversationPropagationsTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ // This is a client test, use a real (non-mocked) Seam deployment
+ WebArchive war =
Deployments.realSeamDeployment().addClasses(ConversationAction.class, MyException.class,
+ MyConversationEndingException.class);
+
+ war.delete("WEB-INF/pages.xml");
+
+
war.addAsWebResource("org/jboss/seam/test/integration/faces/conversations/conversations.xhtml",
+ "conversations.xhtml")
+
.addAsWebResource("org/jboss/seam/test/integration/faces/conversations/error.xhtml",
"error.xhtml")
+
.addAsWebResource("org/jboss/seam/test/integration/faces/conversations/home.xhtml",
"home.xhtml")
+
.addAsWebResource("org/jboss/seam/test/integration/faces/conversations/output.xhtml",
"output.xhtml")
+
.addAsWebInfResource("org/jboss/seam/test/integration/faces/conversations/pages.xml",
"pages.xml");
+
+ return war;
+ }
+
+ @Test
+ public void conversationTest() throws FailingHttpStatusCodeException,
MalformedURLException, IOException
+ {
+ HtmlPage page = client.getPage(contextPath + "conversations.seam");
+ assertEquals("Seam Conversations Test", page.getTitleText());
+ }
+
+ private void testScenario(String output, String... ids) throws
FailingHttpStatusCodeException,
+ MalformedURLException, IOException
+ {
+ HtmlPage page = client.getPage(contextPath + "conversations.seam");
+
+ for (String id : ids)
+ {
+ page.getElementById(FORM_PREFIX_ID + id).click();
+ client.waitForBackgroundJavaScript(JAVASCRIPT_WAIT);
+ page = (HtmlPage) client.getCurrentWindow().getEnclosedPage();
+ }
+
+ page = (HtmlPage) client.getCurrentWindow().getEnclosedPage();
+
+ assertTrue("Page should contain '" + output + "'",
page.getBody().getTextContent().contains(output));
+ }
+
+ private void testCommonScenario(String output, String... ids) throws
FailingHttpStatusCodeException,
+ MalformedURLException, IOException
+ {
+ List<String> allIds = new LinkedList<String>();
+ allIds.add("begin");
+ allIds.add("xyzzy");
+ allIds.addAll(Arrays.asList(ids));
+ testScenario(output, allIds.toArray(new String[]
+ {}));
+
+ // test with AJAX button
+ allIds = new LinkedList<String>();
+ allIds.add("begin");
+ allIds.add("ajax");
+ allIds.addAll(Arrays.asList(ids));
+ testScenario(output, allIds.toArray(new String[]
+ {}));
+ }
+
+ @Test
+ public void testViewOutput() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;viewOutput;. Conversation:
true.", "view_output");
+ }
+
+ @Test
+ public void testRedirectOutput() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;redirectOutput;. Conversation:
true.", "redirect_output");
+ }
+
+ @Test
+ public void testPagesRender() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;pagesRender;. Conversation:
true.", "pages_render");
+ }
+
+ @Test
+ public void testPagesRedirect() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;pagesRedirect;. Conversation:
true.", "pages_redirect");
+ }
+
+ @Test
+ public void testProgrammaticRedirect() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;programmaticRedirect;. Conversation:
true.", "programmatic_redirect");
+ }
+
+ @Test
+ public void testProgrammaticRedirectAjax() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;programmaticRedirect;. Conversation:
true.", "programmatic_redirect_ajax");
+ }
+
+ @Test
+ public void testProgrammaticRedirectNoPropagation() throws Exception
+ {
+ testCommonScenario("Output: . Conversation: false.",
"programmatic_redirect_no_propagation");
+ }
+
+ @Test
+ public void testProgrammaticRedirectNoPropagationAjax() throws Exception
+ {
+ testCommonScenario("Output: . Conversation: false.",
"programmatic_redirect_no_propagation_ajax");
+ }
+
+ @Test
+ public void testOutputLink() throws Exception
+ {
+ testCommonScenario("Output: . Conversation: false.",
"output_link");
+ }
+
+ @Test
+ public void testOutputLinkWithCid() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;. Conversation: true.",
"output_link_with_cid");
+ }
+
+ @Test
+ public void testSButtonActionPropagationNone() throws Exception
+ {
+ testCommonScenario("Output: . Conversation: false.",
"sbutton_view_action_propagation_none");
+ }
+
+ @Test
+ public void testSButtonViewPropagationNone() throws Exception
+ {
+ testCommonScenario("Output: . Conversation: false.",
"sbutton_view_propagation_none");
+ }
+
+ @Test
+ public void testSButtonPropagationJoin() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;. Conversation: true.",
"sbutton_view_propagation_join");
+ }
+
+ @Test
+ public void testSButtonViewPropagationNoneWithConversationPropagationNone() throws
Exception
+ {
+ testCommonScenario("Output: . Conversation: false.",
"sbutton_view_propagation_none_with_conversationPropagation");
+ }
+
+ @Test
+ public void testException() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;raiseException;. Conversation:
true.", "exception");
+ }
+
+ @Test
+ public void testConversationEndingException() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;raiseConversationEndingException;.
Conversation: false.",
+ "conversation_ending_exception");
+ }
+
+ @Test
+ public void testExceptionByAjax() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;raiseException;. Conversation:
true.", "exception_by_ajax");
+ }
+
+ @Test
+ public void testConversationEndingExceptionByAjax() throws Exception
+ {
+ testCommonScenario("Output: begin;xyzzy;raiseConversationEndingException;.
Conversation: false.",
+ "conversation_ending_exception_by_ajax");
+ }
+}
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyConversationEndingException.java
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyConversationEndingException.java
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyConversationEndingException.java 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,6 @@
+package org.jboss.seam.test.integration.faces.conversations;
+
+public class MyConversationEndingException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+}
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyException.java
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyException.java
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/faces/conversations/MyException.java 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,6 @@
+package org.jboss.seam.test.integration.faces.conversations;
+
+public class MyException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+}
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/conversations.xhtml
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/conversations.xhtml
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/conversations.xhtml 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,154 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:a="http://richfaces.org/a4j"
+
xmlns:s="http://jboss.org/schema/seam/taglib">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>Seam Conversations Test</title>
+</h:head>
+<h:body>
+ <h:form id="form">
+
+ <div>
+ <h:commandButton id="begin" value="begin"
+ action="#{ConversationAction.begin()}" />
+ </div>
+
+ <div>
+ <h:commandButton id="end" value="end"
+ action="#{ConversationAction.end()}" />
+ </div>
+
+ <div>
+ <h:commandButton id="view_output" value="view output"
+ action="#{ConversationAction.viewOutput()}" />
+ </div>
+ <div>
+ <h:commandButton id="redirect_output" value="redirect output"
+ action="#{ConversationAction.redirectOutput()}" />
+ </div>
+ <div>
+ <h:commandButton id="pages_render" value="pages render"
+ action="#{ConversationAction.pagesRender}" />
+ </div>
+ <div>
+ <h:commandButton id="pages_redirect" value="pages redirect"
+ action="#{ConversationAction.pagesRedirect}" />
+ </div>
+
+ <div>
+ <h:commandButton id="programmatic_redirect" value="programmatic
redirect"
+ action="#{ConversationAction.programmaticRedirect()}" />
+ </div>
+
+ <div>
+ <h:commandButton id="programmatic_redirect_ajax" value="programmatic
redirect with AJAX"
+ action="#{ConversationAction.programmaticRedirect()}">
+ <f:ajax />
+ </h:commandButton>
+ </div>
+
+ <div>
+ <h:commandButton id="programmatic_redirect_no_propagation"
value="programmatic redirect no propagation"
+
action="#{ConversationAction.programmaticRedirectNoPropagation()}" />
+ </div>
+
+ <div>
+ <h:commandButton id="programmatic_redirect_no_propagation_ajax"
value="programmatic redirect no propagation with AJAX"
+
action="#{ConversationAction.programmaticRedirectNoPropagation()}">
+ <f:ajax />
+ </h:commandButton>
+ </div>
+
+ <div>
+ <h:outputLink id="output_link" value="output.seam">
+ Output Link
+ </h:outputLink>
+ </div>
+
+ <div>
+ <h:outputLink id="output_link_with_cid"
value="output.seam">
+ <s:conversationId />
+ Output Link with cid
+ </h:outputLink>
+ </div>
+
+ <div>
+ <s:button id="sbutton_view_action_propagation_none"
action="#{ConversationAction.viewOutput()}"
+ value="SButton view action no propagation"
propagation="none"></s:button>
+ </div>
+
+ <div>
+ <s:button id="sbutton_view_propagation_none"
view="/output.xhtml" value="SButton view no propagation"
+ propagation="none"></s:button>
+ </div>
+
+ <div>
+ <s:button id="sbutton_view_propagation_join"
view="/output.xhtml" value="SButton view join propagation"
+ propagation="join"></s:button>
+ </div>
+
+ <div>
+ <s:button id="sbutton_view_propagation_none_with_conversationPropagation"
view="/output.xhtml"
+ value="SButton view no propagation with s:conversationPropagation none"
+ propagation="none">
+ <s:conversationPropagation type="none" />
+ </s:button>
+ </div>
+
+ <div>
+ <h:commandButton id="exception" value="exception"
+ action="#{ConversationAction.raiseException()}" />
+ </div>
+ <div>
+ <h:commandButton id="conversation_ending_exception"
+ value="conversation ending exception"
+ action="#{ConversationAction.raiseConversationEndingException()}" />
+ </div>
+
+ <div>
+ <h:commandButton id="exception_by_ajax" value="exception by
AJAX"
+ action="#{ConversationAction.raiseException()}">
+ <f:ajax />
+ </h:commandButton>
+ </div>
+ <div>
+ <h:commandButton id="conversation_ending_exception_by_ajax"
+ value="conversation ending exception by AJAX"
+ action="#{ConversationAction.raiseConversationEndingException()}">
+ <f:ajax />
+ </h:commandButton>
+ </div>
+
+ <div>
+ <h:outputLink id="localhost" value="http://127.0.0.1:8080">
+
http://127.0.0.1:8080
+ </h:outputLink>
+ </div>
+
+ <div>
+ <h:commandButton id="xyzzy"
action="#{ConversationAction.xyzzy}" value="Xyzzy">
+ </h:commandButton>
+ </div>
+
+ <div>
+ <h:commandButton id="ajax" action="#{ConversationAction.xyzzy}"
value="AJAX">
+ <f:ajax render="ajaxOutput"></f:ajax>
+ </h:commandButton>
+ </div>
+
+ <h:panelGroup id="ajaxOutput">
+ <h:outputText value="#{ConversationAction.state}" />
+ <h:outputLink id="ajaxOutput_link" value="output.seam">
+ <s:conversationId />
+ Output Link with cid
+ </h:outputLink>
+ </h:panelGroup>
+
+ </h:form>
+</h:body>
+</html>
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/error.xhtml
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/error.xhtml
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/error.xhtml 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:a="http://richfaces.org/a4j"
+
xmlns:s="http://jboss.org/schema/seam/taglib">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>Seam Conversations Test Error</title>
+</h:head>
+<h:body>
+ <h1>Error</h1>
+ <p>Something bad happened :-(</p>
+
+ <h:messages id="errorMessage" styleClass="message"/>
+</h:body>
+</html>
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/home.xhtml
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/home.xhtml
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/home.xhtml 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:a="http://richfaces.org/a4j"
+
xmlns:s="http://jboss.org/schema/seam/taglib">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>Seam Conversations Test Home</title>
+</h:head>
+<h:body>
+ <h:form id="ConversationActionForm">
+ <s:link view="/conversations.xhtml"
value="Conversations"/>
+ </h:form>
+</h:body>
+</html>
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/output.xhtml
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/output.xhtml
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/output.xhtml 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:s="http://jboss.org/schema/seam/taglib">
+<h:head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>Seam Conversations Test Output</title>
+</h:head>
+<h:body>
+ Output: <h:outputText value="#{ConversationAction.state}"/>.
Conversation: <h:outputText value="#{conversation.longRunning}" />.
+</h:body>
+</html>
Added:
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/pages.xml
===================================================================
---
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/pages.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/resources/org/jboss/seam/test/integration/faces/conversations/pages.xml 2013-02-19
16:05:43 UTC (rev 15412)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages
xmlns="http://jboss.org/schema/seam/pages"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.org/schema/seam/pages
http://jboss.org/schema/seam/pages-2.3.xsd"
+
+ no-conversation-view-id="/home.xhtml"
+ login-view-id="/login.xhtml">
+
+ <page view-id="/conversations.xhtml">
+ <navigation from-action="#{ConversationAction.pagesRender}">
+ <rule if-outcome="render">
+ <render view-id="/output.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation from-action="#{ConversationAction.pagesRedirect}">
+ <rule if-outcome="redirect">
+ <redirect view-id="/output.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+
+ <page view-id="*">
+ <navigation>
+ <rule if-outcome="home">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+ <exception class="org.jboss.seam.framework.EntityNotFoundException">
+ <redirect view-id="/error.xhtml">
+ <message severity="warn">Record not found</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.EntityNotFoundException">
+ <redirect view-id="/error.xhtml">
+ <message severity="warn">Record not found</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.EntityExistsException">
+ <redirect view-id="/error.xhtml">
+ <message severity="warn">Duplicate record</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.OptimisticLockException">
+ <end-conversation/>
+ <redirect view-id="/error.xhtml">
+ <message severity="warn">Another user changed the same data,
please try again</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.security.AuthorizationException">
+ <redirect view-id="/error.xhtml">
+ <message severity="error">You don't have permission to
access this resource</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/login.xhtml">
+ <message
severity="warn">#{messages['org.jboss.seam.NotLoggedIn']}</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/error.xhtml">
+ <message severity="warn">Your session has timed out, please
try again</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.ConcurrentRequestTimeoutException"
log-level="trace">
+ <http-error error-code="503" />
+ </exception>
+
+ <exception
class="org.jboss.seam.test.integration.faces.conversations.MyException">
+ <redirect view-id="/output.xhtml">
+ <message severity="warn">MyException!</message>
+ </redirect>
+ </exception>
+
+ <exception
class="org.jboss.seam.test.integration.faces.conversations.MyConversationEndingException">
+ <end-conversation/>
+ <redirect view-id="/output.xhtml">
+ <message
severity="warn">MyConversationEndingException!</message>
+ </redirect>
+ </exception>
+
+ <exception>
+ <redirect view-id="/error.xhtml">
+ <message severity="error">Unexpected error, please try
again</message>
+ </redirect>
+ </exception>
+</pages>