jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shenoy, Anjali" <anjali.she...@bankofamerica.com>
Subject Testing servlets with cactus
Date Thu, 25 Aug 2005 21:42:33 GMT
Has anyone successfully tested servlets with cactus???

I have the following requirements:

JBuilder - Not really a requirement but convinient.
JRun 3.0

my code looks as follows:

package com.boa.gcib.docwf.newsdm.servlets;

import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
import org.apache.cactus.WebResponse;
import junit.framework.*;

import java.io.*;


public class TestLogin extends ServletTestCase{
private TestLogin loginTest = null;
private static final String USER_ID_KEY = "strUserID";
private static final String PASSWORD_KEY = "strPassword";
private static final String ACTIVE = "Y";

public void beginDummyTest(WebRequest theRequest){
theRequest.setURL("http://localhost", "/servlet", "/com.boa.gcib.docwf.newsdm.servlets.login",
"/", null);
System.out.println(theRequest.getURL().getContextPath());
// theRequest.get
// login.getServletContext().getContext("http://localhost/servlets/com.boa.gcib.docwf.newsdm.servlets.login");
}

// protected void tearDown() throws Exception {
// loginTest = null;
// super.tearDown();
// }

public void testDummyTest(){
assertEquals(loginTest.USER_ID_KEY, "abcde");
}


}

It doesn't matter what I type in or try in the code, when I run the test, it always gives
me a ChainedRuntimeException: Missing cactus property[cactus.contextURL].

But I've already set the URL in the "begin" method!!

Does anyone have any ideas??? Thanks!


Mime
View raw message