[jboss-user] [JBoss Seam] - Integration Testing - Render Response phase

Nogard do-not-reply at jboss.com
Wed Dec 26 02:32:08 EST 2007


Hi all.

I'm using Seam 2.0.1.CR1 and trying to write Seam integration test. I took one from the examples as an example :). Here is the test code (it extends SeamTest):

  | @Test
  | 	public void testLogin() throws Exception {
  | 		new FacesRequest("/login.xhtml") {
  | 			@Override
  | 			protected void updateModelValues() throws Exception {
  | 				setValue("#{identity.username}", ADMIN_USERNAME);
  | 				setValue("#{identity.password}", ADMIN_PASSWORD);
  | 			}
  | 
  | 			@Override
  | 			protected void invokeApplication() throws Exception {
  | 				invokeAction("#{identity.login}");
  | 			}
  | 
  | 			@Override
  | 			protected void renderResponse() throws Exception {
  | 				assert (Boolean) getValue("#{identity.loggedIn}");
  | 			}
  | 		}.run();
  | 
Everything works fine updateModelValues and invokeApplication methods are invoked, authentication is successfull, but renderResponse method is not invoked. I debug it and found this piece of code in emulateJsfLifecycle method of BaseSeamTest class:


  | if ( skipRender() )
  |          {
  |             // we really should look at redirect parameters here!
  |             return false;
  |          }
  |          else
  |          {
  |             renderResponsePhase();
  |             return true;
  |          }
  | 
so skipRender method always returns true and it has only one row inside:

  | FacesContext.getCurrentInstance().getResponseComplete();
  | 
Could anybody explain why it happens, why response is complete, and why renderResponsePhase should be invoked only if it's not? 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115447#4115447

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115447



More information about the jboss-user mailing list