0 Replies Latest reply: May 15, 2012 12:54 PM by eulbergrj RSS

    Seam-Gen Edit Page Does Not Properly Propagate Through JSF Life Cycle in SeamTest

    eulbergrj Newbie



      I am attempting to create a very basic SeamTest class for a super basic Seam generated <Classname>Edit.xhtml facelets page. The problem that I am facing is that, when I run the test using TestNG, the page will not make it past the Restore View phase of the JSF life cycle, which means none of the override methods in the Seam test class, other than the beforeRequest, get invoked.


      Example Test Class


      package org.domain.seamless.test;


      import org.jboss.seam.mock.SeamTest;

      import org.testng.annotations.Test;


      public class MyClassEditTest extends SeamTest {



          public void test() throws Exception {

              System.out.println("hello test 123");


              new FacesRequest("/MyClassEdit.xhtml") {


                  protected void beforeRequest() {

                      System.out.println("beforeRequest Method Invoked");        // <---- WORKS




                  protected void updateModelValues() throws Exception {

                      System.out.println("updateModelValues Method Invoked");    // <---- METHOD NEVER CALLED




                  protected void invokeApplication() {

                      System.out.println("invokeApplication Method Invoked");    // <---- METHOD NEVER CALLED




                  protected void renderResponse() {

                      System.out.println("rendorResponse Method Invoked");    // <---- METHOD NEVER CALLED








      The test classes that I created for <Classname>List.xhtml and <Classname>.xhtml work fine and propogate as expected through each phase of the life cycle.


      All of the Seam classes were Seam generated by right clicking on the project, going to New and Seam Generated Entities. Basically, I am simply creating the Seam project based on some simple table from the database. Nothing fancy here at all and nothing modified after the seam-gen process.


      From a UI perspective, I am testing the "Edit" page that gets called when clicking the Edit link on a row returned from the Search Results page (ie. the "List" page from the "Browse Data" menu option at the top).


      Is there a particular reason why the SeamTest class for the Edit page does not propagate through the JSF life cycle properly?




      JDK 1.6

      Seam 2.2.2 Final

      JBoss 5.1

      JSF 1.2

      JPA 1.0

      Eclipse 3.7.2

      Oracle XE 11g R2



      Thank you for your help!