jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ronnie" <lormee2...@yahoo.com.sg>
Subject Re: Servlet Test Problem
Date Sat, 05 Apr 2003 14:20:25 GMT
Hi Vincent,

It's working!
I knew there was something I forgot to include but just couldn't put a
finger on it.
Thanks alot!

Regards,
Ronnie

----- Original Message -----
From: "Vincent Massol" <vmassol@pivolis.com>
To: "'Cactus Users List'" <cactus-user@jakarta.apache.org>
Sent: Saturday, 05 April, 2003 9:32 PM
Subject: RE: Servlet Test Problem


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


---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org



Mime
View raw message