[jboss-user] [JBoss Seam] - Re: UnitTesting and jBPM pageflow
KnisterPeter
do-not-reply at jboss.com
Tue Jun 26 04:09:42 EDT 2007
String id = new NonFacesRequest("/public/register.xhtml") {
|
| @Override
| protected void renderResponse() throws Exception {
| Contexts.getSessionContext().set("person", new Person());
| invokeMethod("#{register.begin}"); // <-- This is my pageflow start method annoted with @Begin(...)
| Pageflow pageflow = Pageflow.instance();
| assertEquals("register", pageflow.getNode().getName());
| assertTrue(isLongRunningConversation());
| assertEquals("/public/register.xhtml", getRenderedViewId());
| }
|
| }.run();
|
| ... next FacesRequest...
|
| @Override
| protected void invokeApplication() throws Exception {
| Pageflow pageflow = Pageflow.instance();
| pageflow.navigate(getFacesContext(), "next");
| assertEquals("confirm", pageflow.getNode().getName());
| }
|
|
|
As you can see, I'll never start the pageflow directly. I'm using the annotations to start Converstation and seam automatically start my pageflow.
As you further can see in subsequent requests I'll to the transition from node to node with calling pageflow.navigate(...) with my transition name I want to trigger.
I hope this does help you.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057583#4057583
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057583
More information about the jboss-user
mailing list