jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@pivolis.com>
Subject RE: Servlet Test Problem
Date Sat, 05 Apr 2003 13:32:52 GMT
Hi Ronnie,

Please check
http://jakarta.apache.org/cactus/integration/manual/howto_classpath.html
. You’ll see that you need servlet.jar on the client side classpath too.

Thanks
-Vincent

-----Original Message-----
From: Ronnie [mailto:lormee2001@yahoo.com.sg] 
Sent: 05 April 2003 15:13
To: cactus-user@jakarta.apache.org
Subject: Servlet Test Problem

Hi All,
 
I have this problem that has been bugging me and preventing me from
conducting tests on my Servlet! This error pops up whenever I try to run
cactus.
 
 
Exception in thread "main" java.lang.NoClassDefFoundError:
javax/servlet/ServletConfig
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:120)
        at
edu.rmit.isys2049.s00013681.test.AllTests.class$(AllTests.java:13)
        at
edu.rmit.isys2049.s00013681.test.AllTests.suite(AllTests.java:102)
        at
edu.rmit.isys2049.s00013681.test.AllTests.main(AllTests.java:86)
 
 
The following is my java test file:
import junit.framework.*;
import org.apache.cactus.*;
import com.books.DispatcherServlet;
 
public class TestDispatcher extends ServletTestCase {
 
    public TestDispatcher(String name){
      super(name);
    }
 
    public void setUp(WebRequest request) throws Exception {
          request.addParameter("firstName", CUSTOMER_FIRSTNAME);
          request.addParameter("lastName", CUSTOMER_LASTNAME);
          request.addParameter("address", CUSTOMER_ADDRESS);
          request.addParameter("userName", CUSTOMER_USERNAME);
          request.addParameter("password", CUSTOMER_PASSWORD);
          request.addParameter("email", CUSTOMER_EMAIL);
    }//setUp()
 
    public void tearDown() throws Exception {
    }//tearDown()
 
    public void testAddCustomer() throws Exception{
      DispatcherServlet dispatcher = new DispatcherServlet();
 
      dispatcher.init(config);
    }
 
Whenever I remove the "dispatcher.init(config);" line, the testing goes
without a hitch. I really can't see where I've gone wrong!
 
Any help is greatly appreciated.
 
 
Regards,
Ronnie Choo


Mime
View raw message