9 Replies Latest reply on Oct 30, 2006 12:12 PM by Gavin King

    Issues with SeamTest and Pageflow

    Marcio Endo Newbie

      I have just upgraded Seam to 1.1BETA1 and some of my jPDL pageflow unit tests have stopped working. Here are some issues:

      First: if you don't define a 'redirect' tag for each page node, you get a NPE:

      Pageflow.java:

       private void navigate(FacesContext context)
       {
       Page page = getPage();
       if ( !page.isRedirect() )
       {
       UIViewRoot viewRoot = context.getApplication().getViewHandler()
       .createView( context, page.getViewId() );
       context.setViewRoot(viewRoot);
       }
       else
       {
       Manager.instance().redirect( page.getViewId() );
       }
      
       counter++;
       setDirty();
       }
      


      viewRoot is null as the following method is called

      MockViewHandler.java
       @Override
       public UIViewRoot createView(FacesContext ctx, String viewId) {
       return null;
       }
      


      and NPE occurs when it tries to call getViewId() in getViewRoot():

      Pages.java
       public boolean callAction()
       {
       boolean result = false;
       FacesContext facesContext = FacesContext.getCurrentInstance();
       String viewId = facesContext.getViewRoot().getViewId();
       if (viewId!=null)
       {
       for (String wildcard: wildcardViewIds)
       {
       if ( viewId.startsWith( wildcard.substring(0, wildcard.length()-1) ) )
       {
       result = callAction(facesContext, wildcard) || result;
       }
       }
       }
       result = callAction(facesContext, viewId) || result;
       return result;
       }
      


      And, for some reason, the method renderResponse() in SeamTest.Script is not being called whenever you set an outcome in invokeApplication(). Don't know exactly why this is happening yet.

      My testing environment has EJB3_RC9, MyFaces 1.1.4 and Seam1.1B1. It also happens with the environment provided in Seam1.1.B1 package.