/** * Dragon - SOA Governance Platform. * Copyright (c) 2008 EBM Websourcing, http://www.ebmwebsourcing.com/ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * ------------------------------------------------------------------------- * ServletContextMock.java * ------------------------------------------------------------------------- */ package org.ow2.dragon.service; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Set; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.ServletException; /** * @author ofabre - eBM Websourcing * */ public class ServletContextMock implements ServletContext { private Map attributes = new HashMap(); private Map initParameters = new HashMap(); /** * {@inheritDoc} */ public Object getAttribute(String name) { return attributes.get(name); } /** * {@inheritDoc} */ public Enumeration getAttributeNames() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public ServletContext getContext(String uripath) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public String getContextPath() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public String getInitParameter(String name) { return initParameters.get(name); } /** * {@inheritDoc} */ public Enumeration getInitParameterNames() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public int getMajorVersion() { // TODO Auto-generated method stub return 0; } /** * {@inheritDoc} */ public String getMimeType(String file) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public int getMinorVersion() { // TODO Auto-generated method stub return 0; } /** * {@inheritDoc} */ public RequestDispatcher getNamedDispatcher(String name) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public String getRealPath(String path) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public RequestDispatcher getRequestDispatcher(String path) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public URL getResource(String path) throws MalformedURLException { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public InputStream getResourceAsStream(String path) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public Set getResourcePaths(String path) { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public String getServerInfo() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public Servlet getServlet(String name) throws ServletException { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public String getServletContextName() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public Enumeration getServletNames() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public Enumeration getServlets() { // TODO Auto-generated method stub return null; } /** * {@inheritDoc} */ public void log(String msg) { // TODO Auto-generated method stub } /** * {@inheritDoc} */ public void log(Exception exception, String msg) { // TODO Auto-generated method stub } /** * {@inheritDoc} */ public void log(String message, Throwable throwable) { // TODO Auto-generated method stub } /** * {@inheritDoc} */ public void removeAttribute(String name) { // TODO Auto-generated method stub } /** * {@inheritDoc} */ public void setAttribute(String name, Object object) { attributes.put(name, object); } /** * {@inheritDoc} */ public void setInitParameter(String name, String value) { initParameters.put(name, value); } }