File: 001_update-tests-for-servlet3-api.patch

package info (click to toggle)
libcommons-fileupload-java 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 832 kB
  • ctags: 805
  • sloc: java: 4,359; xml: 2,207; makefile: 6
file content (127 lines) | stat: -rw-r--r-- 3,344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Description: Updates the test to compile with the Servlet 3.0 API
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/src/test/java/org/apache/commons/fileupload/MockHttpServletRequest.java
+++ b/src/test/java/org/apache/commons/fileupload/MockHttpServletRequest.java
@@ -22,15 +22,24 @@
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.security.Principal;
+import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
 import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+import javax.servlet.http.Part;
 
 /**
  * @version $Id: MockHttpServletRequest.java 1565255 2014-02-06 13:49:17Z ggregory $
@@ -221,6 +230,10 @@
         return null;
     }
 
+    public String changeSessionId() {
+        return null;
+    }
+
     /**
      * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdValid()
      */
@@ -296,6 +309,10 @@
         return iLength;
     }
 
+    public long getContentLengthLong() {
+        return getContentLength();
+    }
+
     /**
      * For testing attack scenarios in SizesTest.
      */
@@ -485,6 +502,56 @@
         return null;
     }
 
+    public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
+        return false;
+    }
+
+    public void login(String username, String password) throws ServletException {
+    }
+
+    public void logout() throws ServletException {
+    }
+
+    public Collection<Part> getParts() throws IOException, ServletException {
+        return null;
+    }
+
+    public Part getPart(String name) throws IOException, ServletException {
+        return null;
+    }
+
+    public ServletContext getServletContext() {
+        return null;
+    }
+
+    public AsyncContext startAsync() throws IllegalStateException {
+        return null;
+    }
+
+    public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException {
+        return null;
+    }
+
+    public boolean isAsyncStarted() {
+        return false;
+    }
+
+    public boolean isAsyncSupported() {
+        return false;
+    }
+
+    public AsyncContext getAsyncContext() {
+        return null;
+    }
+
+    public DispatcherType getDispatcherType() {
+        return null;
+    }
+
+    public javax.servlet.http.HttpUpgradeHandler upgrade(Class handlerClass) throws IOException, ServletException {
+        return null;
+    }
+
     private static class MyServletInputStream
         extends javax.servlet.ServletInputStream {
 
@@ -513,6 +580,17 @@
             return in.read(b, off, len);
         }
 
+        public boolean isFinished() {
+            return false;
+        }
+
+        public boolean isReady() {
+            return true;
+        }
+
+        public void setReadListener(javax.servlet.ReadListener listener) {
+        }
+
     }
 
 }