com.mockrunner.struts.MapMessageResourcesFactory 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.struts;
import java.util.Map;
import org.apache.struts.util.MessageResources;
import org.apache.struts.util.MessageResourcesFactory;
/**
* Factory for {@link MapMessageResources}.
* If you want this factory to be the default
* factory used in your actions in the tests,
* you should call
* MessageResourcesFactory.setFactoryClass("com.mockrunner.struts.MapMessageResourcesFactory")
*/
public class MapMessageResourcesFactory extends MessageResourcesFactory
{
private static Map theMessages;
/**
* Sets the messages Map
for returned
* {@link MapMessageResources} objects.
* @param messages the message Map
*/
public static void setMessageMap(Map messages)
{
theMessages = messages;
}
public MessageResources createResources(String config)
{
return new MapMessageResources(theMessages, this, config, this.returnNull);
}
}