1 Reply Latest reply on Aug 13, 2010 11:33 AM by Stan Silvert

    No such method Error - getResponseBody

    Jindřich Šonka Newbie

      Hi,

      I am a novice to JSFUnit and I was trying to test very simple xhtml page. I use Facelets - 1.1.15, jsf 1.2., openfaces 2.0, war is build by maven, and running on Bea 9.23.

      I run my page on http://server:port/OFcsFacelets/pages/test.xhtml, and test I call on http://server:port/OFcsFacelets/ServletTestRunner?suite=tests.JSFUnitTest&xsl=cactus-report.xsl&transform=yes

       

      My test code is

       

      public class JSFUnitTest extends org.apache.cactus.ServletTestCase {
          public static Test suite() {
              return new TestSuite(JSFUnitTest.class);
          }

       

          public void testInitialPage() {
              try {
                   JSFSession jsfSession = new JSFSession("/test.xhtml");

                   JSFServerSession server = jsfSession.getJSFServerSession();

                   UIComponent prompt = server.findComponent("htString");

                  assertTrue(prompt.isRendered());

              } catch (IOException e) {
                       System.out.println("******* exception ***********");
              }
          }
      }

       

      I use nekohtml-1.9.13.jar, htmlunit-core-js-2.6.jar, htmlunit-2.6.jar.

       

      When I start the test by calling http://server:port/OFcsFacelets/ServletTestRunner?suite=tests.JSFUnitTest&xsl=cactus-report.xsl&transform=yes, I receive this error. Can anybody help me with solution?

       

      Thank you very much.

      Shony

       

      com.gargoylesoftware.htmlunit.WebResponse.getResponseBody()[B java.lang.NoSuchMethodError: com.gargoylesoftware.htmlunit.WebResponse.getResponseBody()[B
      at org.jboss.jsfunit.framework.FaceletsErrorPageException.isFaceletsErrorPage(FaceletsErrorPageException.java:55)
      at org.jboss.jsfunit.framework.FaceletsErrorPageDetector.afterRequest(FaceletsErrorPageDetector.java:39)
      at org.jboss.jsfunit.framework.JSFUnitWebConnection.notifyListenersAfter(JSFUnitWebConnection.java:103)
      at org.jboss.jsfunit.framework.JSFUnitWebConnection.getResponse(JSFUnitWebConnection.java:84)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439)
      at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1370)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:326)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:387)
      at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:372)
      at org.jboss.jsfunit.framework.SimpleInitialRequestStrategy.doInitialRequest(SimpleInitialRequestStrategy.java:48)
      at org.jboss.jsfunit.framework.WebClientSpec.doInitialRequest(WebClientSpec.java:244)
      at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:80)
      at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:57)
      at tests.JSFUnitTest.testInitialPage(JSFUnitTest.java:21)
      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:224)
      at org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.java)
      at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doPost(JSFUnitServletRedirector.java:46)
      at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody0(ServletTestRedirector.java:72)
      at org.apache.cactus.server.ServletTestRedirector.doGet_aroundBody1$advice(ServletTestRedirector.java:224)
      at org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.java)
      at org.jboss.jsfunit.framework.JSFUnitServletRedirector.doGet(JSFUnitServletRedirector.java:52)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:116)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3242)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2010)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1916)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)