1 Reply Latest reply on Oct 14, 2008 2:47 AM by Ryan Cuprak

    TestNG Maven and RichFaces - exception during integration testing

    Ryan Cuprak Newbie

      Hello,
      Last night I added RichFaces to my application and immediately got integration test failures when I ran the Maven build (exception below). The unit test is dead simply and extends SeamTest with one method that prints Hello World. I am using Seam version 2.1.0.CR1 and Maven version 3.2.1.GA. Digging around on the web I see other people have run into this problem but there aren't any solutions posted (other than not having RichFaces on the test classpath which isn't possible with Maven).


      Any pointers would be appreciated! Is anyone else using Maven, TestNG, and RichFaces with it successfully working?


      -Thanks,
      -Ryan


      javax.servlet.ServletException: ServletContext not allow to getResourceAsStream for /WEB-INF/web.xml
              at org.ajax4jsf.webapp.WebXml.init(WebXml.java:131)
              at org.ajax4jsf.resource.InternetResourceService.init(InternetResourceService.java:130)
              at org.ajax4jsf.webapp.BaseFilter.init(BaseFilter.java:181)
              at org.jboss.seam.web.Ajax4jsfFilter.init(Ajax4jsfFilter.java:82)
              at org.jboss.seam.servlet.SeamFilter.init(SeamFilter.java:97)
              at org.jboss.seam.mock.AbstractSeamTest.createSeamFilter(AbstractSeamTest.java:976)
              at org.jboss.seam.mock.AbstractSeamTest.setupClass(AbstractSeamTest.java:953)
              at org.jboss.seam.mock.SeamTest.setupClass(SeamTest.java:44)
              at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62)
              at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:141)
              at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
              at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
              at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)

        • 1. Re: TestNG Maven and RichFaces - exception during integration testing
          Ryan Cuprak Newbie

          I made some progress on figuring this out.
          When I created my maven project I used the maven-archetype-webapp. This results in a webapp directory under which I place my WEB-INF and web.xml files.
          Project layout:


          src
          -main
          --java
          --resources
          --webapp
          ---WEB-INF
          ----web.xml
          -test
          --java




          If I create WEB-INF/web.xml under test it works just file:



          -test
          --java
          --resources
          ---WEB-INF
          ----web.xml




          I am guessing others must be using a different maven project structure?


          Regards,

          -Ryan