Package org.exoplatform.services.rest.impl

Examples of org.exoplatform.services.rest.impl.MultivaluedMapImpl.clear()


         TestUtils.stream2string((FileInputStream)response.getEntity(), WIN_CHARSET).getBytes(WIN_CHARSET);
      assertTrue(Arrays.equals(WIN_CONTENT, responseContent));
      assertEquals(WIN_CONTENT_TYPE, response.getContentType().toString());
      // System.out.println("Content in Cp1251 encoding:\t" + new String(responseContent,
      // WIN_CHARSET));
      headers.clear();

      headers.add(HttpHeaders.CONTENT_TYPE, ISO_CONTENT_TYPE);
      response = service("PUT", getPathWS() + ISO_FILE, "", headers, ISO_CONTENT);
      assertEquals(HTTPStatus.CREATED, response.getStatus());
      response = service("GET", getPathWS() + ISO_FILE, "", null, null);
View Full Code Here


         TestUtils.stream2string((FileInputStream)response.getEntity(), ISO_CHARSET).getBytes(ISO_CHARSET);
      assertTrue(Arrays.equals(ISO_CONTENT, responseContent));
      assertEquals(ISO_CONTENT_TYPE, response.getContentType().toString());
      // System.out.println("Content in Cp1251 encoding:\t" + new String(responseContent,
      // ISO_CHARSET));
      headers.clear();
   }

   public void testRewriteEncodedFile() throws Exception
   {
View Full Code Here

         TestUtils.stream2string((FileInputStream)response.getEntity(), ISO_CHARSET).getBytes(ISO_CHARSET);
      assertTrue(Arrays.equals(ISO_CONTENT, responseContent));
      assertEquals(ISO_CONTENT_TYPE, response.getContentType().toString());
      // System.out.println("Content in ISO-8859-5 encoding:\t"
      // + new String(responseContent, ISO_CHARSET));
      headers.clear();

      headers.add(HttpHeaders.CONTENT_TYPE, WIN_CONTENT_TYPE);
      response = service("PUT", getPathWS() + ISO_FILE, "", headers, WIN_CONTENT);
      assertEquals(HTTPStatus.CREATED, response.getStatus());
      response = service("GET", getPathWS() + ISO_FILE, "", null, null);
View Full Code Here

      TypeProducer t = ParameterHelper.createTypeProducer(StringValueOf.class, null);
      MultivaluedMap<String, String> values = new MultivaluedMapImpl();
      values.putSingle("key1", "valueof test");
      StringValueOf o1 = (StringValueOf)t.createValue("key1", values, null);
      assertEquals("valueof test", o1.getValue());
      values.clear();
      o1 = (StringValueOf)t.createValue("key1", values, "default value");
      assertEquals("default value", o1.getValue());
   }

   public static class StringValueOf
View Full Code Here

      TypeProducer t = ParameterHelper.createTypeProducer(StringConstructor.class, null);
      MultivaluedMap<String, String> values = new MultivaluedMapImpl();
      values.putSingle("key1", "string constructor test");
      StringConstructor o1 = (StringConstructor)t.createValue("key1", values, null);
      assertEquals("string constructor test", o1.getValue());
      values.clear();
      o1 = (StringConstructor)t.createValue("key1", values, "default value");
      assertEquals("default value", o1.getValue());
   }

   public static class StringConstructor
View Full Code Here

      MultivaluedMap<String, String> h = new MultivaluedMapImpl();
      h.putSingle("foo", "to be or not to be");
      h.putSingle("bar", "to be or not to be");
      assertEquals(204, launcher.service("GET", "/a/test/8/test", "", h, null, null).getStatus());

      h.clear();
      h.putSingle("Content-Type", "application/x-www-form-urlencoded");
      assertEquals(204, launcher.service("POST", "/a/test/9/test", "", h,
         "bar=to%20be%20or%20not%20to%20be&foo=to%20be%20or%20not%20to%20be".getBytes("UTF-8"), null).getStatus());

      h.clear();
View Full Code Here

      h.clear();
      h.putSingle("Content-Type", "application/x-www-form-urlencoded");
      assertEquals(204, launcher.service("POST", "/a/test/9/test", "", h,
         "bar=to%20be%20or%20not%20to%20be&foo=to%20be%20or%20not%20to%20be".getBytes("UTF-8"), null).getStatus());

      h.clear();
      h.putSingle("Cookie",
         "$Version=1;foo=foo;$Domain=exo.com;$Path=/exo,$Version=1;bar=ar;$Domain=exo.com;$Path=/exo");
      assertEquals(204, launcher.service("GET", "/a/test/11/test", "", h, null, null).getStatus());

      assertEquals(204, launcher.service("GET", "/a/111/12/222", "", null, null, null).getStatus());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.