I think that page parameters do not work in integration tests.

I have the following test:

ItemTest.java

  | public class ItemTest extends SeamTest {
  | 
  |     @Test
  |     public void testRequestParameterAnnotation() throws Exception {
  |             new NonFacesRequest("/item.xhtml") {
  | 
  |                     @Override
  |                     protected void beforeRequest() {
  |                             setParameter("itemId", "1");
  |                     }
  | 
  |                     @Override
  |                     protected void renderResponse() throws Exception {
  |                             checkItemRetrieval(getValue("#{itemHome}"));
  |                     }
  |             }.run();
  |     }
  |     
  |     @Test
  |     public void testPageParameter() throws Exception {
  |             new NonFacesRequest("/item.xhtml") {
  | 
  |                     @Override
  |                     protected void beforeRequest() {
  |                             setParameter("id", "1");
  |                     }
  | 
  |                     @Override
  |                     protected void renderResponse() throws Exception {
  |                             checkItemRetrieval(getValue("#{itemHome}"));
  |                     }
  |             }.run();
  |     }
  | 
  |     private void checkItemRetrieval(Object object) {
  |             ItemHome itemHome = (ItemHome) object;
  |             assert itemHome.getInstance().getId() != null;
  |     }
  | }
  | 

ItemHome.java

  | 
  | @Name("itemHome")
  | public class ItemHome extends EntityHome<Item>
  | {
  | 
  |     @RequestParameter 
  |     Long itemId;
  |     
  |     @Override
  |     public Object getId() 
  |     { 
  |         if (itemId==null)
  |         {
  |             return super.getId();
  |         }
  |         else
  |         {
  |             return itemId;
  |         }
  |     }
  | }
  | 

pages.xml

  | <page view-id="/item.xhtml">
  |   <param name="id" 
  |     value="#{itemHome.id}" 
  |     converterId="javax.faces.Long"/>
  | </page>
  | 

The first test passes, but the second one fails.  Am I doing this correctly?
If so, I'll open a jira issue.  
I'm using cvs HEAD.
Thanks.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036121
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to