WarJSFPrimeFacesIntegrationTest.testJSF() does not work


Currently the main test method in WarJSFPrimefacesIntegrationTest (testJSF()) is not executed. In the pax-web-itest-container-jetty directory there is no test annotation at it (and it does not correctly parse and fill the form). I fixed these issues in pax-web-itest-container-tomcat, but the test does still not work (but the application does if executed in the browser).

The workflow is executed fine and the form is filled in in the same way as with a browser (so I think that part is ok), but the response of the post request does not contain the name, which is put into the form.

I have checked the (working) workflow with a browser analysis tool and noticed that the two requests in the tests actually result in three HTTP request. The get request that gets the form (which works), the post requests, where the form is filled in, which actually gets a HTTP 302 status code with a redirect to the success.xhtml and another get request to that page. My feeling is that the final (indirect) get request does not get the cookies that are required to get the user name from the session (but I have no proof for that).




Marc Schlegel
March 16, 2017, 9:19 AM

Thanks for the analysis. Will try to fix it on the weekend

Stephan Siano
March 17, 2017, 12:04 PM

with https://github.com/ops4j/org.ops4j.pax.web/pull/93
the HTTP session handling is fixed. The test works with tomcat then, but it still fails on jetty. One reason for that is that there are bugs in the test (e.g. wrong URL for the form, wrong parsing of the javax.faces.ViewState hidden form field), but even if I fix these issues, the test still fails.

Marc Schlegel
March 17, 2017, 12:08 PM

Hey Stephan

Thanks for the PR. I am currently working on the issue and also experiment with the CookieStore. I will merge your changes and see what I can do about Jetty.

Merged: https://github.com/ops4j/org.ops4j.pax.web/commit/4db1359b35e73fda9e37654f617736622b16aa01

Marc Schlegel
March 17, 2017, 12:28 PM

Thanks to for solving the cookie-handling

Jetty-Test updated with https://github.com/ops4j/org.ops4j.pax.web/commit/54cb1c0ff81868c93b1f150251f942100d07aa79


Marc Schlegel


Stephan Siano




Affects versions