1 Reply Latest reply on Jul 17, 2009 8:06 AM by Stan Silvert

    Seam Test Bug?

    Sean Wu Newbie

      Hi all,

      I hope to test seam applications with JSFUnit. I download seam registration jsfunit demo from JSFUnit site and deploy it to JBoss AS 4.2.3.GA(JDK 1.5). I run the test from web broswer and it shows all tests passed, but If I run it again (simply refresh the page) the testGoToRegisteredPage is failed with following error:
      -----------------------------------------
      expected:<...ed...> but was:<......>

      junit.framework.ComparisonFailure: expected:<...ed...> but was:<......>
      at org.jboss.jsfunit.seam.registration.RegistrationTest.testGoToRegisteredPage(RegistrationTest.java:88)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at org.apache.cactus.internal.AbstractCactusTestCase.runBareServer(AbstractCactusTestCase.java:153)
      at org.apache.cactus.internal.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.java:119)
      at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody0(AbstractWebTestController.java:93)
      at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest_aroundBody1$advice(AbstractWebTestController.java:224)
      at org.apache.cactus.internal.server.AbstractWebTestController.handleRequest(AbstractWebTestController.java)
      at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody2(ServletTestRedirector.java:101)
      at org.apache.cactus.server.ServletTestRedirector.doPost_aroundBody3$advice(ServletTestRedirector.java:217)
      at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
      -----------------------------------------------
      I got error info from JBoss AS log file:
      ------------------------------------------------
      aused by: java.lang.IllegalStateException: Cannot create a session after the response has been committed
      at org.apache.catalina.connector.Request.doGetSession(Request.java:2301)
      at org.apache.catalina.connector.Request.getSession(Request.java:2075)
      at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
      at org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:87)
      at org.jboss.seam.servlet.ServletRequestSessionMap.put(ServletRequestSessionMap.java:25)
      at org.jboss.seam.contexts.BasicContext.set(BasicContext.java:80)
      at org.jboss.seam.Component.newInstance(Component.java:1975)
      at org.jboss.seam.Component.getInstance(Component.java:1873)
      at org.jboss.seam.Component.getInstance(Component.java:1852)
      at org.jboss.seam.Component.getInstance(Component.java:1829)
      at org.jboss.seam.Component.getInstance(Component.java:1824)
      -------------------------------------------
      I checked JIRA and found there is a same report as mine except it is run on JBoss AS 5 and the status is fixed. Can somebody help?
      BTW, the demo's version is 1.0.0.Beta3.ear

        • 1. Re: Seam Test Bug?
          Stan Silvert Master

          Hi,

          The registration demo hasn't been updated in a long time. The one I've been using for tests is the booking demo.

          For JSFUnit 1.1.0, I decided not to release the examples since the build process creates a version that is only usable on Tomcat 5 and Jetty. The examples in Maven for Seam were never intended to be downloaded. They just got uploaded as part of the build/release process.

          Anyway, if you want to look at a Seam example I suggest that you build the booking demo from SVN. Here are the instructions for that. If you have trouble, I'll be glad to help:
          http://labs.jboss.com/jsfunit/building-jsfunit.html

          Regards,

          Stan