jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleksey.koro...@g2x.com
Subject Re: Cactus and HttpUnit
Date Thu, 29 Jan 2004 18:49:43 GMT
Hi, Barbara!
Check bug # 23978 (http://issues.apache.org/bugzilla/show_bug.cgi?id=23978)
It seems to me you have the same problem as described in this bug.

Aleksey.







Barbara Allori <ballori@akros.it>
29/01/2004 17:32
Please respond to "Cactus Users List"

 
        To:     cactus-user@jakarta.apache.org
        cc: 
        Subject:        Cactus and HttpUnit


Hi,
I'm try to testing my jsp using cactus end httpUnit.

I write test like this:

public class testClass extends ServletTestCase {
         .....

         public void testTest1() throws ServletException, IOException {
      ....
         bean bean = new bean();
         bean.setRuoloUtente(entitaRuolo);
         session.setAttribute("xyz",bean);

         RequestDispatcher rd 
= 
config.getServletContext().getRequestDispatcher("/jsp/test.jsp");
         rd.include(request,response);

         }
         public void endTest1(WebResponse response) {

         assertEquals("OK",response.getResponseMessage());
         try {

         WebForm form = response.getFormWithName("Form");
         ....

         } catch (SAXException e) {
                 ....
         }
         }
}

and when I run it, I catch this exception:

java.lang.NullPointerException
at 
com.meterware.httpunit.ParsedHTML.getIncludedScript(ParsedHTML.java:305)
at com.meterware.httpunit.ParsedHTML.getScript(ParsedHTML.java:289)
at 
com.meterware.httpunit.ParsedHTML.interpretScriptElement(ParsedHTML.java:269)
at com.meterware.httpunit.ParsedHTML.access$600(ParsedHTML.java:37)
at 
com.meterware.httpunit.ParsedHTML$ScriptFactory.recordElement(ParsedHTML.java:404)
at com.meterware.httpunit.ParsedHTML$2.processElement(ParsedHTML.java:556)
at 
com.meterware.httpunit.NodeUtils$PreOrderTraversal.perform(NodeUtils.java:169)
at com.meterware.httpunit.ParsedHTML.loadElements(ParsedHTML.java:566)
at com.meterware.httpunit.ParsedHTML.getForms(ParsedHTML.java:101)
at 
com.meterware.httpunit.ParsedHTML.getFirstMatchingForm(ParsedHTML.java:239)
at com.meterware.httpunit.ParsedHTML.getFormWithName(ParsedHTML.java:264)
at 
com.meterware.httpunit.WebResponse.getFormWithName(WebResponse.java:320)


I use:

cactus 1.4.1
httpunit 1.5.4
junit 3.8.1

This is my classpath:


SET CLASSPATH=%CLASSPATH%;%HTTP_UNIT%\lib\httpunit.jar
SET CLASSPATH=%CLASSPATH%;%HTTP_UNIT%\jars\nekohtml.jar
SET CLASSPATH=%CLASSPATH%;%HTTP_UNIT%\jars\js.jar
SET CLASSPATH=%CLASSPATH%;%CACTUS_HOME%\lib\catalina-ant.jar
SET CLASSPATH=%CLASSPATH%;%CACTUS_HOME%\lib\commons-logging-1.0.jar
SET CLASSPATH=%CLASSPATH%;%JUNIT%\junit.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\optional.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\ant.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\xalan-2.3.1.jar
SET CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\xercesImpl.jar
SET CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
SET CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\cactus-1.4.1.jar
SET CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\server\lib\catalina-ant.jar

Where I wrong? Can anyone help me?

Thanks,
Barbara

P.S.
Excuse me for my bad english!





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message