| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Google Web Toolkit
Revision: 3590
Author: scottb@google.com
Date: 28 Aug 2008 18:43:56
Changes:Cleaning up r3589, merging of releases/1.5 into trunk
Some added files failed to add.
Files:| ... | ...@@ -0,0 +1,140 @@ | |
| 1 | /* | |
| 2 | * Copyright 2008 Google Inc. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| 5 | * use this file except in compliance with the License. You may obtain a copy of | |
| 6 | * the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
| 13 | * License for the specific language governing permissions and limitations under | |
| 14 | * the License. | |
| 15 | */ | |
| 16 | package com.google.gwt.user.server.rpc; | |
| 17 | ||
| 18 | import java.io.InputStream; | |
| 19 | import java.net.MalformedURLException; | |
| 20 | import java.net.URL; | |
| 21 | import java.util.Enumeration; | |
| 22 | import java.util.Set; | |
| 23 | ||
| 24 | import javax.servlet.RequestDispatcher; | |
| 25 | import javax.servlet.Servlet; | |
| 26 | import javax.servlet.ServletContext; | |
| 27 | import javax.servlet.ServletException; | |
| 28 | ||
| 29 | @SuppressWarnings(value = {"deprecation", "unchecked"}) | |
| 30 | abstract class LogFilterServletContext implements ServletContext { | |
| 31 | private final ServletContext realContext; | |
| 32 | ||
| 33 | public LogFilterServletContext(ServletContext realContext) { | |
| 34 | this.realContext = realContext; | |
| 35 | } | |
| 36 | ||
| 37 | public Object getAttribute(String name) { | |
| 38 | return realContext.getAttribute(name); | |
| 39 | } | |
| 40 | ||
| 41 | public Enumeration getAttributeNames() { | |
| 42 | return realContext.getAttributeNames(); | |
| 43 | } | |
| 44 | ||
| 45 | public ServletContext getContext(String uripath) { | |
| 46 | return realContext.getContext(uripath); | |
| 47 | } | |
| 48 | ||
| 49 | public String getInitParameter(String name) { | |
| 50 | return realContext.getInitParameter(name); | |
| 51 | } | |
| 52 | ||
| 53 | public Enumeration getInitParameterNames() { | |
| 54 | return realContext.getInitParameterNames(); | |
| 55 | } | |
| 56 | ||
| 57 | public int getMajorVersion() { | |
| 58 | return realContext.getMajorVersion(); | |
| 59 | } | |
| 60 | ||
| 61 | public String getMimeType(String file) { | |
| 62 | return realContext.getMimeType(file); | |
| 63 | } | |
| 64 | ||
| 65 | public int getMinorVersion() { | |
| 66 | return realContext.getMinorVersion(); | |
| 67 | } | |
| 68 | ||
| 69 | public RequestDispatcher getNamedDispatcher(String name) { | |
| 70 | return realContext.getNamedDispatcher(name); | |
| 71 | } | |
| 72 | ||
| 73 | public String getRealPath(String path) { | |
| 74 | return realContext.getRealPath(path); | |
| 75 | } | |
| 76 | ||
| 77 | public RequestDispatcher getRequestDispatcher(String path) { | |
| 78 | return realContext.getRequestDispatcher(path); | |
| 79 | } | |
| 80 | ||
| 81 | public URL getResource(String path) throws MalformedURLException { | |
| 82 | return realContext.getResource(path); | |
| 83 | } | |
| 84 | ||
| 85 | public InputStream getResourceAsStream(String path) { | |
| 86 | return realContext.getResourceAsStream(path); | |
| 87 | } | |
| 88 | ||
| 89 | public Set getResourcePaths(String path) { | |
| 90 | return realContext.getResourcePaths(path); | |
| 91 | } | |
| 92 | ||
| 93 | public String getServerInfo() { | |
| 94 | return realContext.getServerInfo(); | |
| 95 | } | |
| 96 | ||
| 97 | public Servlet getServlet(String name) throws ServletException { | |
| 98 | return realContext.getServlet(name); | |
| 99 | } | |
| 100 | ||
| 101 | public String getServletContextName() { | |
| 102 | return realContext.getServletContextName(); | |
| 103 | } | |
| 104 | ||
| 105 | public Enumeration getServletNames() { | |
| 106 | return realContext.getServletNames(); | |
| 107 | } | |
| 108 | ||
| 109 | public Enumeration getServlets() { | |
| 110 | return realContext.getServlets(); | |
| 111 | } | |
| 112 | ||
| 113 | public void log(Exception exception, String msg) { | |
| 114 | if (shouldLog(exception, msg)) { | |
| 115 | realContext.log(exception, msg); | |
| 116 | } | |
| 117 | } | |
| 118 | ||
| 119 | public void log(String msg) { | |
| 120 | if (shouldLog(null, msg)) { | |
| 121 | realContext.log(msg); | |
| 122 | } | |
| 123 | } | |
| 124 | ||
| 125 | public void log(String msg, Throwable throwable) { | |
| 126 | if (shouldLog(throwable, msg)) { | |
| 127 | realContext.log(msg, throwable); | |
| 128 | } | |
| 129 | } | |
| 130 | ||
| 131 | public void removeAttribute(String name) { | |
| 132 | realContext.removeAttribute(name); | |
| 133 | } | |
| 134 | ||
| 135 | public void setAttribute(String name, Object object) { | |
| 136 | realContext.setAttribute(name, object); | |
| 137 | } | |
| 138 | ||
| 139 | protected abstract boolean shouldLog(Throwable t, String msg); | |
| 140 | } | |
| 0 | 141 | \ No newline at end of file |
| ... | ...@@ -0,0 +1,251 @@ | |
| 1 | /* | |
| 2 | * Copyright 2008 Google Inc. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| 5 | * use this file except in compliance with the License. You may obtain a copy of | |
| 6 | * the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
| 13 | * License for the specific language governing permissions and limitations under | |
| 14 | * the License. | |
| 15 | */ | |
| 16 | package com.google.gwt.user.server.rpc; | |
| 17 | ||
| 18 | import java.io.BufferedReader; | |
| 19 | import java.io.IOException; | |
| 20 | import java.security.Principal; | |
| 21 | import java.util.Enumeration; | |
| 22 | import java.util.Locale; | |
| 23 | import java.util.Map; | |
| 24 | ||
| 25 | import javax.servlet.RequestDispatcher; | |
| 26 | import javax.servlet.ServletInputStream; | |
| 27 | import javax.servlet.http.Cookie; | |
| 28 | import javax.servlet.http.HttpServletRequest; | |
| 29 | import javax.servlet.http.HttpSession; | |
| 30 | ||
| 31 | /** | |
| 32 | * A dummy class for testing methods that require an HttpServletRequest. | |
| 33 | */ | |
| 34 | class MockHttpServletRequest implements HttpServletRequest { | |
| 35 | ||
| 36 | public Object getAttribute(String arg0) { | |
| 37 | throw new UnsupportedOperationException(); | |
| 38 | } | |
| 39 | ||
| 40 | public Enumeration getAttributeNames() { | |
| 41 | throw new UnsupportedOperationException(); | |
| 42 | } | |
| 43 | ||
| 44 | public String getAuthType() { | |
| 45 | throw new UnsupportedOperationException(); | |
| 46 | } | |
| 47 | ||
| 48 | public String getCharacterEncoding() { | |
| 49 | throw new UnsupportedOperationException(); | |
| 50 | } | |
| 51 | ||
| 52 | public int getContentLength() { | |
| 53 | throw new UnsupportedOperationException(); | |
| 54 | } | |
| 55 | ||
| 56 | public String getContentType() { | |
| 57 | throw new UnsupportedOperationException(); | |
| 58 | } | |
| 59 | ||
| 60 | public String getContextPath() { | |
| 61 | throw new UnsupportedOperationException(); | |
| 62 | } | |
| 63 | ||
| 64 | public Cookie[] getCookies() { | |
| 65 | throw new UnsupportedOperationException(); | |
| 66 | } | |
| 67 | ||
| 68 | public long getDateHeader(String arg0) { | |
| 69 | throw new UnsupportedOperationException(); | |
| 70 | } | |
| 71 | ||
| 72 | public String getHeader(String arg0) { | |
| 73 | throw new UnsupportedOperationException(); | |
| 74 | } | |
| 75 | ||
| 76 | public Enumeration getHeaderNames() { | |
| 77 | throw new UnsupportedOperationException(); | |
| 78 | } | |
| 79 | ||
| 80 | public Enumeration getHeaders(String arg0) { | |
| 81 | throw new UnsupportedOperationException(); | |
| 82 | } | |
| 83 | ||
| 84 | public ServletInputStream getInputStream() throws IOException { | |
| 85 | throw new UnsupportedOperationException(); | |
| 86 | } | |
| 87 | ||
| 88 | public int getIntHeader(String arg0) { | |
| 89 | throw new UnsupportedOperationException(); | |
| 90 | } | |
| 91 | ||
| 92 | public String getLocalAddr() { | |
| 93 | throw new UnsupportedOperationException(); | |
| 94 | } | |
| 95 | ||
| 96 | public Locale getLocale() { | |
| 97 | throw new UnsupportedOperationException(); | |
| 98 | } | |
| 99 | ||
| 100 | public Enumeration getLocales() { | |
| 101 | throw new UnsupportedOperationException(); | |
| 102 | } | |
| 103 | ||
| 104 | public String getLocalName() { | |
| 105 | throw new UnsupportedOperationException(); | |
| 106 | } | |
| 107 | ||
| 108 | public int getLocalPort() { | |
| 109 | throw new UnsupportedOperationException(); | |
| 110 | } | |
| 111 | ||
| 112 | public String getMethod() { | |
| 113 | throw new UnsupportedOperationException(); | |
| 114 | } | |
| 115 | ||
| 116 | public String getParameter(String arg0) { | |
| 117 | throw new UnsupportedOperationException(); | |
| 118 | } | |
| 119 | ||
| 120 | public Map getParameterMap() { | |
| 121 | throw new UnsupportedOperationException(); | |
| 122 | } | |
| 123 | ||
| 124 | public Enumeration getParameterNames() { | |
| 125 | throw new UnsupportedOperationException(); | |
| 126 | } | |
| 127 | ||
| 128 | public String[] getParameterValues(String arg0) { | |
| 129 | throw new UnsupportedOperationException(); | |
| 130 | } | |
| 131 | ||
| 132 | public String getPathInfo() { | |
| 133 | throw new UnsupportedOperationException(); | |
| 134 | } | |
| 135 | ||
| 136 | public String getPathTranslated() { | |
| 137 | throw new UnsupportedOperationException(); | |
| 138 | } | |
| 139 | ||
| 140 | public String getProtocol() { | |
| 141 | throw new UnsupportedOperationException(); | |
| 142 | } | |
| 143 | ||
| 144 | public String getQueryString() { | |
| 145 | throw new UnsupportedOperationException(); | |
| 146 | } | |
| 147 | ||
| 148 | public BufferedReader getReader() throws IOException { | |
| 149 | throw new UnsupportedOperationException(); | |
| 150 | } | |
| 151 | ||
| 152 | public String getRealPath(String arg0) { | |
| 153 | throw new UnsupportedOperationException(); | |
| 154 | } | |
| 155 | ||
| 156 | public String getRemoteAddr() { | |
| 157 | throw new UnsupportedOperationException(); | |
| 158 | } | |
| 159 | ||
| 160 | public String getRemoteHost() { | |
| 161 | throw new UnsupportedOperationException(); | |
| 162 | } | |
| 163 | ||
| 164 | public int getRemotePort() { | |
| 165 | throw new UnsupportedOperationException(); | |
| 166 | } | |
| 167 | ||
| 168 | public String getRemoteUser() { | |
| 169 | throw new UnsupportedOperationException(); | |
| 170 | } | |
| 171 | ||
| 172 | public RequestDispatcher getRequestDispatcher(String arg0) { | |
| 173 | throw new UnsupportedOperationException(); | |
| 174 | } | |
| 175 | ||
| 176 | public String getRequestedSessionId() { | |
| 177 | throw new UnsupportedOperationException(); | |
| 178 | } | |
| 179 | ||
| 180 | public String getRequestURI() { | |
| 181 | throw new UnsupportedOperationException(); | |
| 182 | } | |
| 183 | ||
| 184 | public StringBuffer getRequestURL() { | |
| 185 | throw new UnsupportedOperationException(); | |
| 186 | } | |
| 187 | ||
| 188 | public String getScheme() { | |
| 189 | throw new UnsupportedOperationException(); | |
| 190 | } | |
| 191 | ||
| 192 | public String getServerName() { | |
| 193 | throw new UnsupportedOperationException(); | |
| 194 | } | |
| 195 | ||
| 196 | public int getServerPort() { | |
| 197 | throw new UnsupportedOperationException(); | |
| 198 | } | |
| 199 | ||
| 200 | public String getServletPath() { | |
| 201 | throw new UnsupportedOperationException(); | |
| 202 | } | |
| 203 | ||
| 204 | public HttpSession getSession() { | |
| 205 | throw new UnsupportedOperationException(); | |
| 206 | } | |
| 207 | ||
| 208 | public HttpSession getSession(boolean arg0) { | |
| 209 | throw new UnsupportedOperationException(); | |
| 210 | } | |
| 211 | ||
| 212 | public Principal getUserPrincipal() { | |
| 213 | throw new UnsupportedOperationException(); | |
| 214 | } | |
| 215 | ||
| 216 | public boolean isRequestedSessionIdFromCookie() { | |
| 217 | throw new UnsupportedOperationException(); | |
| 218 | } | |
| 219 | ||
| 220 | public boolean isRequestedSessionIdFromUrl() { | |
| 221 | throw new UnsupportedOperationException(); | |
| 222 | } | |
| 223 | ||
| 224 | public boolean isRequestedSessionIdFromURL() { | |
| 225 | throw new UnsupportedOperationException(); | |
| 226 | } | |
| 227 | ||
| 228 | public boolean isRequestedSessionIdValid() { | |
| 229 | throw new UnsupportedOperationException(); | |
| 230 | } | |
| 231 | ||
| 232 | public boolean isSecure() { | |
| 233 | throw new UnsupportedOperationException(); | |
| 234 | } | |
| 235 | ||
| 236 | public boolean isUserInRole(String arg0) { | |
| 237 | throw new UnsupportedOperationException(); | |
| 238 | } | |
| 239 | ||
| 240 | public void removeAttribute(String arg0) { | |
| 241 | throw new UnsupportedOperationException(); | |
| 242 | } | |
| 243 | ||
| 244 | public void setAttribute(String arg0, Object arg1) { | |
| 245 | throw new UnsupportedOperationException(); | |
| 246 | } | |
| 247 | ||
| 248 | public void setCharacterEncoding(String arg0) { | |
| 249 | throw new UnsupportedOperationException(); | |
| 250 | } | |
| 251 | } |
| ... | ...@@ -0,0 +1,232 @@ | |
| 1 | /* | |
| 2 | * Copyright 2008 Google Inc. | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| 5 | * use this file except in compliance with the License. You may obtain a copy of | |
| 6 | * the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
| 12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
| 13 | * License for the specific language governing permissions and limitations under | |
| 14 | * the License. | |
| 15 | */ | |
| 16 | ||
| 17 | package com.google.gwt.user.server.rpc; | |
| 18 | ||
| 19 | import junit.framework.TestCase; | |
| 20 | ||
| 21 | import java.io.IOException; | |
| 22 | ||
| 23 | import javax.servlet.ServletException; | |
| 24 | import javax.servlet.ServletInputStream; | |
| 25 | import javax.servlet.http.HttpServletRequest; | |
| 26 | ||
| 27 | /** | |
| 28 | * Tests some of the methods in {@link RPCServletUtils}. | |
| 29 | * | |
| 30 | */ | |
| 31 | public class RPCServletUtilsTest extends TestCase { | |
| 32 | ||
| 33 | /** | |
| 34 | * Mocks a request with the specified Content-Type. | |
| 35 | */ | |
| 36 | class MockReqContentType extends MockHttpServletRequest { | |
| 37 | String mockContent = "abcdefg"; | |
| 38 | final String mockContentType; | |
| 39 | ||
| 40 | public MockReqContentType(String contentType) { | |
| 41 | this.mockContentType = contentType; | |
| 42 | } | |
| 43 | ||
| 44 | @Override | |
| 45 | public String getCharacterEncoding() { | |
| 46 | return "charset=utf-8"; | |
| 47 | } | |
| 48 | ||
| 49 | @Override | |
| 50 | public int getContentLength() { | |
| 51 | return mockContent.length(); | |
| 52 | } | |
| 53 | ||
| 54 | @Override | |
| 55 | public String getContentType() { | |
| 56 | return mockContentType; | |
| 57 | } | |
| 58 | ||
| 59 | @Override | |
| 60 | public String getHeader(String name) { | |
| 61 | if (name.toLowerCase().equals("Content-Type")) { | |
| 62 | return mockContentType; | |
| 63 | } | |
| 64 | return ""; | |
| 65 | } | |
| 66 | ||
| 67 | @SuppressWarnings("unused") | |
| 68 | @Override | |
| 69 | public ServletInputStream getInputStream() throws IOException { | |
| 70 | return new MockServletInputStream(mockContent); | |
| 71 | } | |
| 72 | } | |
| 73 | ||
| 74 | class MockServletInputStream extends ServletInputStream { | |
| 75 | private boolean readOnce = false; | |
| 76 | final private String value; | |
| 77 | ||
| 78 | MockServletInputStream(String value) { | |
| 79 | this.value = value; | |
| 80 | } | |
| 81 | ||
| 82 | @Override | |
| 83 | public int read() throws IOException { | |
| 84 | throw new UnsupportedOperationException(); | |
| 85 | } | |
| 86 | ||
| 87 | @Override | |
| 88 | public int read(byte[] b, int off, int len) throws IOException { | |
| 89 | if (readOnce) { | |
| 90 | // simulate EOF | |
| 91 | return -1; | |
| 92 | } | |
| 93 | readOnce = true; | |
| 94 | ||
| 95 | int pos = 0; | |
| 96 | int i; | |
| 97 | for (i = off; i < len; ++i, ++pos) { | |
| 98 | b[i] = (byte) (this.value.charAt(pos) % 0xff); | |
| 99 | } | |
| 100 | return i; | |
| 101 | } | |
| 102 | ||
| 103 | @Override | |
| 104 | public int readLine(byte[] b, int off, int len) throws IOException { | |
| 105 | return read(b, off, len); | |
| 106 | } | |
| 107 | } | |
| 108 | ||
| 109 | /** | |
| 110 | * Content type doesn't match x-gwt-rpc, but ignore it. | |
| 111 | */ | |
| 112 | public void testIgnoreContentType() throws IOException, ServletException { | |
| 113 | HttpServletRequest m = new MockReqContentType( | |
| 114 | "application/www-form-encoded"); | |
| 115 | RPCServletUtils.readContentAsUtf8(m, false); | |
| 116 | } | |
| 117 | ||
| 118 | /** | |
| 119 | * Character type doesn't match UTF-8, but ignore it. | |
| 120 | */ | |
| 121 | public void testIgnoreCharacterEncoding() throws IOException, | |
| 122 | ServletException { | |
| 123 | HttpServletRequest m = new MockReqContentType("text/x-gwt-rpc") { | |
| 124 | ||
| 125 | @Override | |
| 126 | public String getCharacterEncoding() { | |
| 127 | return "charset=EBCDIC-US"; | |
| 128 | } | |
| 129 | }; | |
| 130 | ||
| 131 | RPCServletUtils.readContentAsUtf8(m, false); | |
| 132 | } | |
| 133 | ||
| 134 | /** | |
| 135 | * A non UTF-8 character encoding should be rejected. | |
| 136 | */ | |
| 137 | public void testReadBadCharacterEncoding() throws IOException { | |
| 138 | HttpServletRequest m = new MockReqContentType("text/x-gwt-rpc") { | |
| 139 | ||
| 140 | @Override | |
| 141 | public String getCharacterEncoding() { | |
| 142 | return "charset=EBCDIC-US"; | |
| 143 | } | |
| 144 | }; | |
| 145 | boolean gotException = false; | |
| 146 | ||
| 147 | try { | |
| 148 | RPCServletUtils.readContentAsUtf8(m); | |
| 149 | } catch (ServletException se) { | |
| 150 | if (se.getMessage().indexOf("Character Encoding") != 0) { | |
| 151 | fail(" Unexpected exception " + se); | |
| 152 | } | |
| 153 | gotException = true; | |
| 154 | } | |
| 155 | ||
| 156 | if (!gotException) { | |
| 157 | fail("Expected exception from illegal character encoding"); | |
| 158 | } | |
| 159 | } | |
| 160 | ||
| 161 | /** | |
| 162 | * Implement a content type other than text/x-gwt-rpc. | |
| 163 | */ | |
| 164 | public void testReadBadContentType() throws IOException { | |
| 165 | HttpServletRequest m = new MockReqContentType( | |
| 166 | "application/www-form-encoded"); | |
| 167 | boolean gotException = false; | |
| 168 | try { | |
| 169 | RPCServletUtils.readContentAsUtf8(m); | |
| 170 | } catch (ServletException se) { | |
| 171 | if (se.getMessage().indexOf("Content-Type") != 0) { | |
| 172 | fail(" Unexpected exception " + se); | |
| 173 | } | |
| 174 | gotException = true; | |
| 175 | } | |
| 176 | if (!gotException) { | |
| 177 | fail("Expected exception from illegal content type"); | |
| 178 | } | |
| 179 | } | |
| 180 | ||
| 181 | /** | |
| 182 | * Implement a test that returns content-type text/x-gwt-rpc. | |
| 183 | */ | |
| 184 | public void testReadGoodContentType() throws IOException, ServletException { | |
| 185 | HttpServletRequest m = new MockReqContentType("text/x-gwt-rpc"); | |
| 186 | RPCServletUtils.readContentAsUtf8(m); | |
| 187 | } | |
| 188 | ||
| 189 | /** | |
| 190 | * A null character encoding should be rejected. | |
| 191 | */ | |
| 192 | public void testReadNullCharacterEncoding() throws IOException { | |
| 193 | HttpServletRequest m = new MockReqContentType("text/x-gwt-rpc") { | |
| 194 | ||
| 195 | @Override | |
| 196 | public String getCharacterEncoding() { | |
| 197 | return null; | |
| 198 | } | |
| 199 | }; | |
| 200 | boolean gotException = false; | |
| 201 | try { | |
| 202 | RPCServletUtils.readContentAsUtf8(m); | |
| 203 | } catch (ServletException se) { | |
| 204 | if (se.getMessage().indexOf("Character Encoding") != 0) { | |
| 205 | fail(" Unexpected exception " + se); | |
| 206 | } | |
| 207 | gotException = true; | |
| 208 | } | |
| 209 | if (!gotException) { | |
| 210 | fail("Expected exception from null character encoding"); | |
| 211 | } | |
| 212 | } | |
| 213 | ||
| 214 | /** | |
| 215 | * A null content type should be rejected. | |
| 216 | */ | |
| 217 | public void testReadNullContentType() throws IOException { | |
| 218 | HttpServletRequest m = new MockReqContentType(null); | |
| 219 | boolean gotException = false; | |
| 220 | try { | |
| 221 | RPCServletUtils.readContentAsUtf8(m); | |
| 222 | } catch (ServletException se) { | |
| 223 | if (se.getMessage().indexOf("Content-Type") != 0) { | |
| 224 | fail(" Unexpected exception " + se); | |
| 225 | } | |
| 226 | gotException = true; | |
| 227 | } | |
| 228 | if (!gotException) { | |
| 229 | fail("Expected exception from null content type"); | |
| 230 | } | |
| 231 | } | |
| 232 | } |