com.mockrunner.mock.web.MockActionServlet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockrunner-jdk1.3-j2ee1.3 Show documentation
Show all versions of mockrunner-jdk1.3-j2ee1.3 Show documentation
Mockrunner is a lightweight framework for unit testing applications
in the J2EE environment. It supports servlets, filters, tag classes
and Struts actions. It includes a JDBC a JMS and a JCA test
framework and can be used to test EJB based applications.
The newest version!
package com.mockrunner.mock.web;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import org.apache.struts.action.ActionServlet;
/**
* This mock version of the Struts ActionServlet
* is necessary, because some Struts methods use it to
* get the ServletContext
and other things.
*/
public class MockActionServlet extends ActionServlet
{
private ServletConfig config;
private ServletContext context;
/**
* Returns the ServletConfig
.
* @return the ServletConfig
*/
public ServletConfig getServletConfig()
{
return config;
}
/**
* Returns the ServletContext
.
* @return the ServletContext
*/
public ServletContext getServletContext()
{
return context;
}
/**
* Set the ServletConfig
.
* @param config the ServletConfig
*/
public void setServletConfig(ServletConfig config)
{
this.config = config;
}
/**
* Set the ServletContext
.
* @param context the ServletContext
*/
public void setServletContext(ServletContext context)
{
this.context = context;
}
}