com.mockrunner.mock.web.MockActionServlet Maven / Gradle / Ivy
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;
}
}