struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [1/5] struts git commit: WW-4510 Upgrade spring plugin dependencies to spring version 4.x
Date Mon, 08 Jun 2015 17:27:19 GMT
Repository: struts
Updated Branches:
  refs/heads/master 7d2370e01 -> e47a1127f


WW-4510 Upgrade spring plugin dependencies to spring version 4.x

- Struts Mocks in JSON and JFreechart plugin needs to be implement the new Spring4 mocks api


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/27bfb22d
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/27bfb22d
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/27bfb22d

Branch: refs/heads/master
Commit: 27bfb22df7321e6a31c0585c16c723e59a654980
Parents: 7d2370e
Author: Johannes Geppert <johgep@gmail.com>
Authored: Mon Jun 8 19:09:09 2015 +0200
Committer: Johannes Geppert <johgep@gmail.com>
Committed: Mon Jun 8 19:09:09 2015 +0200

----------------------------------------------------------------------
 .../struts2/dispatcher/ChartResultTest.java     |  18 ++-
 .../struts2/json/StrutsMockServletContext.java  | 150 +++++++++++++++++--
 2 files changed, 153 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/27bfb22d/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
----------------------------------------------------------------------
diff --git a/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
b/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
index b4a09a0..e285d21 100644
--- a/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
+++ b/plugins/jfreechart/src/test/java/org/apache/struts2/dispatcher/ChartResultTest.java
@@ -21,19 +21,19 @@
 
 package org.apache.struts2.dispatcher;
 
-import org.apache.struts2.ServletActionContext;
-import org.apache.struts2.StrutsTestCase;
-import org.easymock.EasyMock;
-
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.ActionProxy;
 import com.opensymphony.xwork2.util.ValueStack;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.StrutsTestCase;
+import org.easymock.EasyMock;
 import org.jfree.chart.ChartFactory;
 import org.jfree.chart.JFreeChart;
 import org.jfree.data.general.DefaultPieDataset;
 
 import javax.servlet.ServletOutputStream;
+import javax.servlet.WriteListener;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
@@ -196,5 +196,15 @@ public class ChartResultTest extends StrutsTestCase {
         public void write(int arg0) throws IOException {
             written = true;
         }
+
+        @Override
+        public boolean isReady() {
+            return true;
+        }
+
+        @Override
+        public void setWriteListener(WriteListener writeListener) {
+            // no-op
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/struts/blob/27bfb22d/plugins/json/src/test/java/org/apache/struts2/json/StrutsMockServletContext.java
----------------------------------------------------------------------
diff --git a/plugins/json/src/test/java/org/apache/struts2/json/StrutsMockServletContext.java
b/plugins/json/src/test/java/org/apache/struts2/json/StrutsMockServletContext.java
index c500c46..05d70e5 100644
--- a/plugins/json/src/test/java/org/apache/struts2/json/StrutsMockServletContext.java
+++ b/plugins/json/src/test/java/org/apache/struts2/json/StrutsMockServletContext.java
@@ -19,18 +19,12 @@
 
 package org.apache.struts2.json;
 
-import javax.servlet.RequestDispatcher;
-import javax.servlet.Servlet;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
+import javax.servlet.*;
+import javax.servlet.descriptor.JspConfigDescriptor;
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 
 /**
@@ -46,8 +40,12 @@ public class StrutsMockServletContext implements ServletContext {
     Map attributes = new HashMap();
     InputStream resourceAsStream;
 
-    public void setInitParameter(String name, String value) {
+    public boolean setInitParameter(String name, String value) {
+        if (this.initParams.containsKey(name)) {
+            return false;
+        }
         initParams.put(name, value);
+        return true;
     }
 
     public void setRealPath(String value) {
@@ -63,13 +61,23 @@ public class StrutsMockServletContext implements ServletContext {
     }
 
     public int getMajorVersion() {
-        return 0;
+        return 3;
     }
 
     public int getMinorVersion() {
         return 0;
     }
 
+    @Override
+    public int getEffectiveMajorVersion() {
+        return 3;
+    }
+
+    @Override
+    public int getEffectiveMinorVersion() {
+        return 0;
+    }
+
     public String getMimeType(String s) {
         return null;
     }
@@ -154,6 +162,126 @@ public class StrutsMockServletContext implements ServletContext {
         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 extends Servlet> T createServlet(Class<T> aClass) throws ServletException
{
+        return null;
+    }
+
+    @Override
+    public ServletRegistration getServletRegistration(String s) {
+        return null;
+    }
+
+    @Override
+    public Map<String, ? extends ServletRegistration> 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 extends Filter> T createFilter(Class<T> aClass) throws ServletException
{
+        return null;
+    }
+
+    @Override
+    public FilterRegistration getFilterRegistration(String s) {
+        return null;
+    }
+
+    @Override
+    public Map<String, ? extends FilterRegistration> getFilterRegistrations() {
+        return null;
+    }
+
+    @Override
+    public SessionCookieConfig getSessionCookieConfig() {
+        return null;
+    }
+
+    @Override
+    public void setSessionTrackingModes(Set<SessionTrackingMode> set) {
+
+    }
+
+    @Override
+    public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
+        return null;
+    }
+
+    @Override
+    public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+        return null;
+    }
+
+    @Override
+    public void addListener(String s) {
+
+    }
+
+    @Override
+    public <T extends EventListener> void addListener(T t) {
+
+    }
+
+    @Override
+    public void addListener(Class<? extends EventListener> aClass) {
+
+    }
+
+    @Override
+    public <T extends EventListener> T createListener(Class<T> 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;
+    }
+
     public void setServletInfo(String servletInfo) {
         this.servletInfo = servletInfo;
     }


Mime
View raw message