Hi all,

Does anyone here use StrutsTestCase?

I'm getting an NPE I haven't been able to figure out and haven't gotten
any response from the associated forum at SourceForge. Just in case
somebody here could help, here are the details:

My class looks like this:

public class CreateActionTest extends MockStrutsTestCase {

        // Public methods
/////////////////////////////////////////////////////

        public CreateActionTest(String name) {
                super(name);
        }

        public void setUp() throws Exception {
                super.setUp();
        }
        
        public void tearDown() throws Exception {
                super.tearDown();
        }
        
        public void testCreateAction() {
                setRequestPathInfo("/home/user-preferences/modify");
                addRequestParameter("application","6");
                actionPerform();

etc.

The NPE is thrown on the line where actionPerform() is called. I've got
a mock datasource in use, and that does seem to be getting initialized
correctly. The directory where WEB-INF lives is in my classpath, as is a
lot of other stuff matching the classpath for the other JUnit tests set
up for our application.

I've tried to run the debugger in Eclipse, and I think I've found the
line in MockStrutsTestCase where the NPE is thrown:

            this.getActionServlet().doPost(request,response);

The getActionServlet method does the initializing for the actionServlet
and that seems to be returning something (I suppose it could be null,
but doesn't seem to be: it has some of the mappings from the
struts-config.xml file in place).

I'm running out of ideas at this point. Does anyone here have some
insight for me? Thank you!

Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to