Author: aparfonov
Date: 2009-09-10 07:21:37 -0400 (Thu, 10 Sep 2009)
New Revision: 166
Modified:
ws/trunk/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java
Log:
EXOJCR-152 :
Modified:
ws/trunk/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java
===================================================================
---
ws/trunk/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java 2009-09-10
11:21:01 UTC (rev 165)
+++
ws/trunk/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java 2009-09-10
11:21:37 UTC (rev 166)
@@ -23,14 +23,13 @@
import org.exoplatform.services.rest.impl.EnvironmentContext;
import org.exoplatform.services.rest.impl.InputHeadersMap;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
-import org.exoplatform.testframework.MockHttpServletRequest;
import org.exoplatform.services.rest.tools.DummyContainerResponseWriter;
+import org.exoplatform.testframework.MockHttpServletRequest;
import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.net.URI;
-import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.MultivaluedMap;
@@ -47,7 +46,7 @@
// }
public ContainerResponse service(String method, String requestURI, String baseURI,
- MultivaluedMap<String, String> headers, byte[] data, ContainerResponseWriter
writer) throws Exception
+ Map<String, List<String>> headers, byte[] data, ContainerResponseWriter
writer) throws Exception
{
if (headers == null)
@@ -57,17 +56,13 @@
if (data != null)
in = new ByteArrayInputStream(data);
- HashMap<String, List> map = new HashMap();
- map.putAll((HashMap)headers);
-
-
EnvironmentContext envctx = new EnvironmentContext();
HttpServletRequest httpRequest =
- new MockHttpServletRequest("",in, in != null ? in.available() : 0,
method, map);
+ new MockHttpServletRequest("", in, in != null ? in.available() : 0,
method, headers);
envctx.put(HttpServletRequest.class, httpRequest);
EnvironmentContext.setCurrent(envctx);
ContainerRequest request =
- new ContainerRequest(method, new URI(requestURI), new URI(baseURI), in,
headers);
+ new ContainerRequest(method, new URI(requestURI), new URI(baseURI), in, new
InputHeadersMap(headers));
ContainerResponse response = new ContainerResponse(writer);
requestHandler.handleRequest(request, response);
return response;