4 Replies Latest reply on Dec 29, 2009 10:10 AM by ssilvert

    Problem with testing richfaces applicaiton

      Hi,

      In my sample project I've added JSFUnit test. But I have errors when I create new JSFSession exeption is thrown. My configuration is similar to http://anonsvn.jboss.org/repos/jsfunit/trunk/jboss-jsfunit-richfaces (pom and web.xml). The only difference is that, I'm not using Seam in my project. So all Seam stuff is not included in my web.xml.
      I've tried following configurations:
      - Richfaces 3.3.1/3.3.2
      - JSFUnit 1.1.0.GA/1.2.0.GA-SNAPSHOT
      - HtmlUnit 2.5/2.6
      I run my project on Tomcat 6 and also have pure HtmlUnit test that work fine.

      I include a test output.
      Thanks in advance.

      -------------------------------------------------------------------------------
      Test set: integration.jsfunit.NavigationTest
      -------------------------------------------------------------------------------
      Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.218 sec <<< FAILURE!
      testMainMenuNavigationCustomers(integration.jsfunit.NavigationTest) Time elapsed: 4.141 sec <<< ERROR!
      ======= EXCEPTION START ========
      Exception class=[net.sourceforge.htmlunit.corejs.javascript.WrappedException]
      com.gargoylesoftware.htmlunit.ScriptException: Wrapped java.lang.Exception: Cannot set the width property to invalid value: null (http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf#19)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:526)
       at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:529)
       at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:536)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:424)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:399)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:899)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:309)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:364)
       at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:213)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:238)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:690)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:648)
       at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1132)
       at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1034)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
       at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3058)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1994)
       at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:907)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:892)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:447)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330)
       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:259)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:81)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:58)
       at integration.jsfunit.NavigationTest.testMainMenuNavigationCustomers(NavigationTest.java:29)
      Caused by: net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped java.lang.Exception: Cannot set the width property to invalid value: null (http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf#19)
       at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1789)
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.setWidthOrHeight(HTMLElement.java:2261)
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableColElement.jsxSet_width(HTMLTableColElement.java:89)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:161)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.putImpl(ScriptableObject.java:2354)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.put(ScriptableObject.java:350)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.putProperty(ScriptableObject.java:1965)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1558)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1548)
       at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1394)
       at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
       at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:427)
       at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:263)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3058)
       at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:415)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:520)
       ... 74 more
      Caused by: java.lang.Exception: Cannot set the width property to invalid value: null
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.setWidthOrHeight(HTMLElement.java:2260)
       ... 94 more
      WrappedException: net.sourceforge.htmlunit.corejs.javascript.WrappedException: Wrapped java.lang.Exception: Cannot set the width property to invalid value: null (http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf#19)
       at net.sourceforge.htmlunit.corejs.javascript.Context.throwAsScriptRuntimeEx(Context.java:1789)
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.setWidthOrHeight(HTMLElement.java:2261)
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableColElement.jsxSet_width(HTMLTableColElement.java:89)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:161)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.putImpl(ScriptableObject.java:2354)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.put(ScriptableObject.java:350)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.putProperty(ScriptableObject.java:1965)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1558)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1548)
       at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1394)
       at script(http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf:19)
       at script(http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf:23)
       at script(http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf:5)
       at script(http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/common-scrollable-data-table.js.jsf:33)
       at script(http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg/richfaces/renderkit/html/scripts/extended-data-table.js.jsf:5)
       at script.klass(http://localhost:8080/disposal-web-company/a4j/g/3_3_1.GAorg.ajax4jsf.javascript.PrototypeScript.jsf:4)
       at script(script in http://localhost:8080/disposal-web-company/pages/periodslist.jsf from (59, 7454) to (76, 17):61)
       at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
       at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:427)
       at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:263)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3058)
       at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:415)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:520)
       at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:529)
       at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:536)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:424)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:399)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:899)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:309)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:364)
       at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:213)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:238)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:690)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:648)
       at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1132)
       at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1034)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
       at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3058)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1994)
       at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:907)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:892)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:447)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330)
       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:259)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:81)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:58)
       at integration.jsfunit.NavigationTest.testMainMenuNavigationCustomers(NavigationTest.java:29)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       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:217)
       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)
       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:217)
       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:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:119)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.Exception: Cannot set the width property to invalid value: null
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.setWidthOrHeight(HTMLElement.java:2260)
       ... 94 more
      Inside wrapped exception:
      java.lang.Exception: Cannot set the width property to invalid value: null
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement.setWidthOrHeight(HTMLElement.java:2260)
       at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLTableColElement.jsxSet_width(HTMLTableColElement.java:89)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at net.sourceforge.htmlunit.corejs.javascript.MemberBox.invoke(MemberBox.java:161)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.putImpl(ScriptableObject.java:2354)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.put(ScriptableObject.java:350)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptableObject.putProperty(ScriptableObject.java:1965)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1558)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.setObjectProp(ScriptRuntime.java:1548)
       at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpretLoop(Interpreter.java:1394)
       at net.sourceforge.htmlunit.corejs.javascript.Interpreter.interpret(Interpreter.java:845)
       at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.doTopCall(ContextFactory.java:427)
       at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.doTopCall(HtmlUnitContextFactory.java:263)
       at net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3058)
       at net.sourceforge.htmlunit.corejs.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$5.doRun(JavaScriptEngine.java:415)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:520)
       at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:529)
       at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:536)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:424)
       at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScriptEngine.java:399)
       at com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptIfPossible(HtmlPage.java:899)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeInlineScriptIfNeeded(HtmlScript.java:309)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:364)
       at com.gargoylesoftware.htmlunit.html.HtmlScript$1.execute(HtmlScript.java:213)
       at com.gargoylesoftware.htmlunit.html.HtmlScript.onAllChildrenAddedToPage(HtmlScript.java:238)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:690)
       at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.endElement(HTMLParser.java:648)
       at org.cyberneko.html.HTMLTagBalancer.callEndElement(HTMLTagBalancer.java:1132)
       at org.cyberneko.html.HTMLTagBalancer.endElement(HTMLTagBalancer.java:1034)
       at org.cyberneko.html.filters.DefaultFilter.endElement(DefaultFilter.java:206)
       at org.cyberneko.html.filters.NamespaceBinder.endElement(NamespaceBinder.java:329)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scanEndElement(HTMLScanner.java:3058)
       at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1994)
       at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:907)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499)
       at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:892)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:350)
       at com.gargoylesoftware.htmlunit.html.HTMLParser.parseHtml(HTMLParser.java:304)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:134)
       at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:101)
       at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:447)
       at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:330)
       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:259)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:81)
       at org.jboss.jsfunit.jsfsession.JSFSession.<init>(JSFSession.java:58)
       at integration.jsfunit.NavigationTest.testMainMenuNavigationCustomers(NavigationTest.java:29)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at junit.framework.TestCase.runTest(TestCase.java:154)
       at junit.framework.TestCase.runBare(TestCase.java:127)
       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:217)
       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)
       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:217)
       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:690)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.jsfunit.framework.JSFUnitFilter.doFilter(JSFUnitFilter.java:119)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      ======= EXCEPTION END ========
      
      


        • 1. Re: Problem with testing richfaces applicaiton
          ssilvert

          Hi Marcin,

           

          I've been out for several days and I'm trying to get caught up.  Are you still having this problem?

           

          Stan

          • 2. Re: Problem with testing richfaces applicaiton

            Hi Stan,

             

            Well, when I've tried today and it's working (I didn't touch the project since my latest post). I suppose that my problem is a restult of wierd Elicpse/WTP behaviour . If I'll find cause of this error I'll post it in this thread.

             

            My second problem is how to test rich:panelMenuItems. I have this problem also in plain HtmlUnit. How to get a current page if rich:panelMenuItem is clicked? From my research it doesn't work as expected beacause html code generated by richfaces component doesn't contain a javascript code for onclick event. In case of this richfaces component it is done by "external" js objects, so click() method from HtmlUnit's HtmlElement class return the current page - not the new one.
            What are ways to grab reference to the current page or verify navigation done by panelMenu component?

             

            Here are code snippets:

            - generated html code for rich:panelMenuItem

             

            <td style="width: 100%;" id="iconinvoices" class="dr-pmenu-group-self-label
            rich-pmenu-item-label"><input type="hidden"
            name="panelMenuActioninvoices"/>Invoices</td>

             

            - js code for this panelMenuItem

             

            var params = new Object();params['current'] = 'invoices';new
            PanelMenuItem(ids,
            params,{myId:'invoices',parentId:'j_id16'},{type:"item",onopen:"",onclose:""
            *,event:"click"*,mode:"server",target:"",disabled:false,target:"",name:"invoices"},{},new
            Array("dr-pmenu-hovered-element","rich-pmenu-hovered-element"),1,false,true,false,"A4J.AJAX.Submit('_viewRoot',null,event,{'similarityGroupingId':'invoices','parameters':{'current':'invoices','invoices':'invoices'}
            ,'actionUrl':'/web\x2Dcompany/*pages/invoiceslist.jsf'*}
            )","","left","/web-company/a4j/g/3_3_1.GAorg.richfaces.renderkit.html.iconimages.PanelMenuIconGrid/DATB/eAFLP78AAAN2Adc_.jsf","/web-company/a4j/g/3_3_1.GAorg.richfaces.renderkit.html.iconimages.PanelMenuIconGrid/DATB/eAFLP78AAAN2Adc_.jsf"
            ,""
            ,"/web-company/a4j/g/3_3_1.GAorg.richfaces.renderkit.html.iconimages.PanelMenuIconSpacer/DATB/eAFLP78AAAN2Adc_.jsf");

            - exceprt form HtmlElement class

            final ScriptResult scriptResult = fireEvent(event);
            final Page currentPage;
            if (scriptResult == null) {
              currentPage = page;
            }
            else {
                            currentPage = scriptResult.getNewPage();
            }

             

            In my case scriptResult is always null.

             

            Thanks for help,

            Marcin

            • 3. Re: Problem with testing richfaces applicaiton
              ssilvert
              Hi Marcin,

              Again, please excuse my slow response.  I usually get to these within a day or two.

              I haven't tried rich:panelMenuItem with JSFUnit yet.

              I'm not sure what you mean by, "How to get a current page".  You can always get the current page with JSFClientSession.getContentPage().  For debugging, you can try the HtmlUnit snooper that is built into JSFUnit.  Or you can create your own customized snooper.  See http://community.jboss.org/wiki/UsingJSFUnitsRequestListener.

              Can you post your markup (facelet or JSP) and your JSFUnit code?  I think that will give me a better idea of what you are trying to do.

              Also, from now on please create a new post for each new problem.

              Thanks,

              Stan
              • 4. Re: Problem with testing richfaces applicaiton
                ssilvert