JSF - Needs fixing
kragoth Dec 16, 2007 9:43 PMHi all,
I've been trying to get JSF unit running for a while now and it seems basically impossible. This is mainly because the documentation is extremely poor on how to get it running.
On the guide it states.
Here are the minimum jars you will need in your WEB-INF/lib.
* jboss-jsfunit-core-1.0-beta-1.jar
* aspectjrt-1.2.1.jar
* cactus-13-1.7.1.jar
* httpunit-1.6.1.jar
* junit-3.8.1.jar
* jtidy-4aug2000r7-dev.jar
This is so far from the truth and I have yet been able to get a single test to run because of jar dependencies which are NOT stated.
The most obvious of course is cargo...funny seeings as your own ant example has it.
But wait it only gets worse... once you do get a few of the missing jars in all I get are errors.
like this:
<error message="org.w3c.tidy.DOMDocumentImpl.getXmlStandalone()Z" type="org.apache.cactus.internal.client.ServletExceptionWrapper"> java.lang.AbstractMethodError: org.w3c.tidy.DOMDocumentImpl.getXmlStandalone()Z at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.setDocumentInfo(DOM2TO.java:373) at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:127) at com.sun.org.apache.xalan.internal.xsltc.trax.DOM2TO.parse(DOM2TO.java:94) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:663) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:709) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313) at org.jboss.jsfunit.facade.DOMUtil.convertToDomLevel2(DOMUtil.java:143) at org.jboss.jsfunit.facade.JSFClientSession.doWebRequest(JSFClientSession.java:189) at org.jboss.jsfunit.facade.JSFClientSession.doInitialRequest(JSFClientSession.java:122) at org.jboss.jsfunit.facade.JSFClientSession.<init>(JSFClientSession.java:75) at gekko.web.jsfunit.JSFUnitTest.testInitialPage(JSFUnitTest.java:24) 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: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.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 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:123) 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.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 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) </error>
Ok, so I search the forum and the only mention i see is upgrade to new version of jtidy... ok so i do that!
But now I just get
<error message="org.w3c.tidy.Tidy.setCharEncoding(I)V" type="org.apache.cactus.internal.client.ServletExceptionWrapper"> java.lang.NoSuchMethodError: org.w3c.tidy.Tidy.setCharEncoding(I)V at com.meterware.httpunit.parsing.JTidyHTMLParser.getParser(JTidyHTMLParser.java:74) at com.meterware.httpunit.parsing.JTidyHTMLParser.parse(JTidyHTMLParser.java:40) at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:255) at com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:1109) at com.meterware.httpunit.WebResponse.getFrames(WebResponse.java:1098) at com.meterware.httpunit.WebResponse.getFrameRequests(WebResponse.java:875) at com.meterware.httpunit.FrameHolder.updateFrames(FrameHolder.java:179) at com.meterware.httpunit.WebWindow.updateFrameContents(WebWindow.java:252) at com.meterware.httpunit.WebClient.updateFrameContents(WebClient.java:485) at com.meterware.httpunit.WebWindow.updateWindow(WebWindow.java:146) at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:130) at com.meterware.httpunit.WebWindow.getResponse(WebWindow.java:121) at com.meterware.httpunit.WebClient.getResponse(WebClient.java:113) at org.jboss.jsfunit.facade.JSFClientSession.doWebRequest(JSFClientSession.java:184) at org.jboss.jsfunit.facade.JSFClientSession.doInitialRequest(JSFClientSession.java:122) at org.jboss.jsfunit.facade.JSFClientSession.<init>(JSFClientSession.java:75) at gekko.web.jsfunit.JSFUnitTest.testInitialPage(JSFUnitTest.java:24) 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: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.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 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:123) 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.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 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.ru n(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) </error>
Would it be at all possible to have a working example or at least some documentation that actually reflects what needs to go on?
Cause as it stands I just can't get jsfunit going