com.brettonw.servlet.test.TestServletContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of servlet-tester Show documentation
Show all versions of servlet-tester Show documentation
Servlet Tester provides a support class to test 'GET' and 'POST' on servlet interfaces.
package com.brettonw.servlet.test;
import javax.servlet.*;
import javax.servlet.descriptor.JspConfigDescriptor;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
public class TestServletContext implements ServletContext {
Map attributes;
public TestServletContext () {
attributes = new HashMap<> ();
}
@Override
public String getContextPath () {
return null;
}
@Override
public ServletContext getContext (String s) {
return null;
}
@Override
public int getMajorVersion () {
return 0;
}
@Override
public int getMinorVersion () {
return 0;
}
@Override
public int getEffectiveMajorVersion () {
return 0;
}
@Override
public int getEffectiveMinorVersion () {
return 0;
}
@Override
public String getMimeType (String s) {
return null;
}
@Override
public Set getResourcePaths (String s) {
return null;
}
@Override
public URL getResource (String s) throws MalformedURLException {
return null;
}
@Override
public InputStream getResourceAsStream (String s) {
return null;
}
@Override
public RequestDispatcher getRequestDispatcher (String s) {
return null;
}
@Override
public RequestDispatcher getNamedDispatcher (String s) {
return null;
}
@Override
public Servlet getServlet (String s) throws ServletException {
return null;
}
@Override
public Enumeration getServlets () {
return null;
}
@Override
public Enumeration getServletNames () {
return null;
}
@Override
public void log (String s) {
}
@Override
public void log (Exception e, String s) {
}
@Override
public void log (String s, Throwable throwable) {
}
@Override
public String getRealPath (String s) {
return null;
}
@Override
public String getServerInfo () {
return null;
}
@Override
public String getInitParameter (String s) {
return null;
}
@Override
public Enumeration getInitParameterNames () {
return null;
}
@Override
public boolean setInitParameter (String s, String s1) {
return false;
}
@Override
public Object getAttribute (String s) {
return attributes.get (s);
}
@Override
public Enumeration getAttributeNames () {
return null;
}
@Override
public void setAttribute (String s, Object o) {
attributes.put (s, o);
}
@Override
public void removeAttribute (String s) {
attributes.remove (s);
}
@Override
public String getServletContextName () {
return null;
}
@Override
public ServletRegistration.Dynamic addServlet (String s, String s1) {
return null;
}
@Override
public ServletRegistration.Dynamic addServlet (String s, Servlet servlet) {
return null;
}
@Override
public ServletRegistration.Dynamic addServlet (String s, Class extends Servlet> aClass) {
return null;
}
@Override
public T createServlet (Class aClass) throws ServletException {
return null;
}
@Override
public ServletRegistration getServletRegistration (String s) {
return null;
}
@Override
public Map getServletRegistrations () {
return null;
}
@Override
public FilterRegistration.Dynamic addFilter (String s, String s1) {
return null;
}
@Override
public FilterRegistration.Dynamic addFilter (String s, Filter filter) {
return null;
}
@Override
public FilterRegistration.Dynamic addFilter (String s, Class extends Filter> aClass) {
return null;
}
@Override
public T createFilter (Class aClass) throws ServletException {
return null;
}
@Override
public FilterRegistration getFilterRegistration (String s) {
return null;
}
@Override
public Map getFilterRegistrations () {
return null;
}
@Override
public SessionCookieConfig getSessionCookieConfig () {
return null;
}
@Override
public void setSessionTrackingModes (Set set) {
}
@Override
public Set getDefaultSessionTrackingModes () {
return null;
}
@Override
public Set getEffectiveSessionTrackingModes () {
return null;
}
@Override
public void addListener (String s) {
}
@Override
public void addListener (T t) {
}
@Override
public void addListener (Class extends EventListener> aClass) {
}
@Override
public T createListener (Class aClass) throws ServletException {
return null;
}
@Override
public JspConfigDescriptor getJspConfigDescriptor () {
return null;
}
@Override
public ClassLoader getClassLoader () {
return null;
}
@Override
public void declareRoles (String... strings) {
}
@Override
public String getVirtualServerName () {
return null;
}
}