4 Replies Latest reply on Mar 12, 2008 1:43 PM by Alok Kumar

    Seam Integration Test failing new FacesRequest(){}

    Alok Kumar Newbie

      i am trying to use SeamTest for integration testing. what I am able to run Unit test cases. When I am trying to run Integration test cases then I am ending up in problem. This is the code snippet which I am trying to run in my test case :


              @Test( alwaysRun=true )
              public void testLoginPage() throws Exception
              {
                      new FacesRequest("/security/login.xhtml")
                      {
                              @Override
                              protected void updateModelValues() throws Exception
                              {
                                      System.out.println("helkjfskljdfsafdasfkhkajsfd");
                                      assert "helo".equals( "helo" );
                              }
                      }.run();
              }
      



      When I am running this test case then this is the exception I am getting. I am not able to understand why is that :


         [testng] FAILED: testLoginPage
         [testng] javax.servlet.ServletException: ServletContext not allow to getResourceAsStream for /WEB-INF/web.xml
         [testng]     at org.ajax4jsf.framework.util.config.WebXml.<init>(WebXml.java:104)
         [testng]     at org.ajax4jsf.framework.resource.ResourceBuilderImpl.init(ResourceBuilderImpl.java:183)
         [testng]     at org.ajax4jsf.framework.resource.InternetResourceService.init(InternetResourceService.java:96)
         [testng]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.getResourceService(BaseFilter.java:278)
         [testng]     at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:207)
         [testng]     at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
         [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]     at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
         [testng]     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
         [testng]     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
         [testng]     at org.jboss.seam.mock.BaseSeamTest$Request.run(BaseSeamTest.java:514)
         [testng]     at com.subexazure.spark.web.app.model.security.LoginTest.testLoginPage(LoginTest.java:11)
         [testng] ... Removed 22 stack frames
      



      What can I do to avoid this.