deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject [3/3] deltaspike git commit: DELTASPIKE-1227 also add Servlet-3.0 methods to mock
Date Fri, 09 Dec 2016 09:32:23 GMT
DELTASPIKE-1227 also add Servlet-3.0 methods to mock

Helps if you have a module with both cdictrl tests + real tomcat integration tests


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/43bdf6ae
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/43bdf6ae
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/43bdf6ae

Branch: refs/heads/master
Commit: 43bdf6ae593aa568e9a40a66215bf0a70659946f
Parents: 9e7f110
Author: Mark Struberg <struberg@apache.org>
Authored: Fri Dec 9 10:31:24 2016 +0100
Committer: Mark Struberg <struberg@apache.org>
Committed: Fri Dec 9 10:31:24 2016 +0100

----------------------------------------------------------------------
 deltaspike/cdictrl/impl-owb/pom.xml             |   3 +-
 .../cdise/owb/MockServletContext.java           | 173 +++++++++++++++++++
 2 files changed, 174 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/43bdf6ae/deltaspike/cdictrl/impl-owb/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/cdictrl/impl-owb/pom.xml b/deltaspike/cdictrl/impl-owb/pom.xml
index 62eea0a..33d4711 100644
--- a/deltaspike/cdictrl/impl-owb/pom.xml
+++ b/deltaspike/cdictrl/impl-owb/pom.xml
@@ -58,8 +58,7 @@
 
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
-            <version>1.2</version>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
             <scope>provided</scope>
         </dependency>
 

http://git-wip-us.apache.org/repos/asf/deltaspike/blob/43bdf6ae/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/MockServletContext.java
----------------------------------------------------------------------
diff --git a/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/MockServletContext.java
b/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/MockServletContext.java
index 149fd20..9c2d8da 100644
--- a/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/MockServletContext.java
+++ b/deltaspike/cdictrl/impl-owb/src/main/java/org/apache/deltaspike/cdise/owb/MockServletContext.java
@@ -22,16 +22,24 @@ import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Enumeration;
+import java.util.EventListener;
 import java.util.Hashtable;
+import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
 
 import javax.enterprise.inject.Typed;
+import javax.servlet.Filter;
+import javax.servlet.FilterRegistration;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
+import javax.servlet.SessionCookieConfig;
+import javax.servlet.SessionTrackingMode;
+import javax.servlet.descriptor.JspConfigDescriptor;
 
 /**
  * Mock ServletContext needed to startup the container.
@@ -63,6 +71,9 @@ public class MockServletContext implements ServletContext
 
 
 
+
+
+
     public Object getAttribute(String name)
     {
         return attributes.get(name);
@@ -188,4 +199,166 @@ public class MockServletContext implements ServletContext
     {
         attributes.put(name, object);
     }
+
+    @Override
+    public boolean setInitParameter(String name, String value)
+    {
+        return false;
+    }
+
+    @Override
+    public ServletRegistration.Dynamic addServlet(String servletName, String className)
+        throws IllegalArgumentException, IllegalStateException
+    {
+        return null;
+    }
+
+    @Override
+    public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet)
+        throws IllegalArgumentException, IllegalStateException
+    {
+        return null;
+    }
+
+    @Override
+    public ServletRegistration.Dynamic addServlet(String servletName, Class<? extends
Servlet> clazz)
+        throws IllegalArgumentException, IllegalStateException
+    {
+        return null;
+    }
+
+    @Override
+    public <T extends Servlet> T createServlet(Class<T> clazz) throws ServletException
+    {
+        return null;
+    }
+
+    @Override
+    public ServletRegistration getServletRegistration(String servletName)
+    {
+        return null;
+    }
+
+    @Override
+    public Map<String, ? extends ServletRegistration> getServletRegistrations()
+    {
+        return null;
+    }
+
+    @Override
+    public FilterRegistration.Dynamic addFilter(String filterName, String className)
+        throws IllegalArgumentException, IllegalStateException
+    {
+        return null;
+    }
+
+    @Override
+    public FilterRegistration.Dynamic addFilter(String filterName, Filter filter)
+        throws IllegalArgumentException, IllegalStateException
+    {
+        return null;
+    }
+
+    @Override
+    public FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter>
filterClass)
+        throws IllegalArgumentException, IllegalStateException
+    {
+        return null;
+    }
+
+    @Override
+    public <T extends Filter> T createFilter(Class<T> clazz) throws ServletException
+    {
+        return null;
+    }
+
+    @Override
+    public FilterRegistration getFilterRegistration(String filterName)
+    {
+        return null;
+    }
+
+    @Override
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations()
+    {
+        return null;
+    }
+
+    @Override
+    public void addListener(Class<? extends EventListener> listenerClass)
+    {
+
+    }
+
+    @Override
+    public void addListener(String className)
+    {
+
+    }
+
+    @Override
+    public <T extends EventListener> void addListener(T t)
+    {
+
+    }
+
+    @Override
+    public <T extends EventListener> T createListener(Class<T> clazz) throws
ServletException
+    {
+        return null;
+    }
+
+    @Override
+    public void declareRoles(String... roleNames)
+    {
+
+    }
+
+    @Override
+    public SessionCookieConfig getSessionCookieConfig()
+    {
+        return null;
+    }
+
+    @Override
+    public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes)
+    {
+
+    }
+
+    @Override
+    public Set<SessionTrackingMode> getDefaultSessionTrackingModes()
+    {
+        return null;
+    }
+
+    @Override
+    public int getEffectiveMajorVersion() throws UnsupportedOperationException
+    {
+        return 0;
+    }
+
+    @Override
+    public int getEffectiveMinorVersion() throws UnsupportedOperationException
+    {
+        return 0;
+    }
+
+    @Override
+    public Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
+    {
+        return null;
+    }
+
+    @Override
+    public ClassLoader getClassLoader()
+    {
+        return null;
+    }
+
+    @Override
+    public JspConfigDescriptor getJspConfigDescriptor()
+    {
+        return null;
+    }
 }


Mime
View raw message