jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ronnie" <lormee2...@yahoo.com.sg>
Subject Servlet Test Problem
Date Sat, 05 Apr 2003 13:13:00 GMT
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