![JAR search and dependency download from the Maven repository](/logo.png)
com.mockrunner.mock.web.MockVariableResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockrunner-jdk1.6-j2ee1.3 Show documentation
Show all versions of mockrunner-jdk1.6-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 java.util.HashMap;
import java.util.Map;
import javax.servlet.jsp.el.ELException;
import javax.servlet.jsp.el.VariableResolver;
/**
* Mock implementation of VariableResolver
.
* This implementation cannot be used for real EL
* expressions. Real EL expression support is only
* available for the Unified Expression Language API
* using the {@link JasperJspFactory}.
*/
public class MockVariableResolver implements VariableResolver
{
private Map variables = new HashMap();
/**
* Adds a variable that resolves to the specified object.
* @param name the variable name
* @param value the variable value
*/
public void addVariable(String name, Object value)
{
variables.put(name, value);
}
/**
* Clears all variables.
*/
public void clearVariables()
{
variables.clear();
}
public Object resolveVariable(String name) throws ELException
{
return variables.get(name);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy