All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.mock.web.MockActionServlet Maven / Gradle / Ivy

Go to download

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy