Package org.apache.commons.httpclient.methods

Examples of org.apache.commons.httpclient.methods.StringRequestEntity


         Assert.assertEquals("basic", method.getResponseBodyAsString());
         method.releaseConnection();
      }
      {
         PutMethod method = new PutMethod("http://localhost:8080/ejb-integration-war/basic");
         method.setRequestEntity(new StringRequestEntity("basic", "text/plain", null));
         int status = client.executeMethod(method);
         Assert.assertEquals(204, status);
         method.releaseConnection();
      }
      {
View Full Code Here


         Assert.assertEquals("basic", method.getResponseBodyAsString());
         method.releaseConnection();
      }
      {
         PutMethod method = new PutMethod("http://localhost:8080/ejb-integration-war/locating/basic");
         method.setRequestEntity(new StringRequestEntity("basic", "text/plain", null));
         int status = client.executeMethod(method);
         Assert.assertEquals(204, status);
         method.releaseConnection();
      }
      {
View Full Code Here

        MyObject o1 = YamlResource.createMyObject();

        String s1 = new Yaml().dump(o1);

        post.setRequestEntity(new StringRequestEntity(s1, "text/x-yaml", "utf-8"));

        client.executeMethod(post);

        Assert.assertEquals(200, post.getStatusCode());
View Full Code Here

    @Test
    public void testBadPost() throws Exception {

        PostMethod post = new PostMethod(TEST_URI);

        post.setRequestEntity(new StringRequestEntity("---! bad", "text/x-yaml", "utf-8"));

        client.executeMethod(post);

        Assert.assertEquals(500, post.getStatusCode());
View Full Code Here

      Assert.assertNotNull(messageBodyReader);
      Assert.assertNotNull(messageBodyReader.getClass());
      Assert.assertEquals(StuffProvider.class, messageBodyReader.getClass());
      HttpClient client = new HttpClient();
      PostMethod post = new PostMethod(generateURL("/stuff"));
      post.setRequestEntity(new StringRequestEntity("bill", "Application/Stuff", null));
      int status = client.executeMethod(post);
      Assert.assertEquals(204, status);


   }
View Full Code Here

      throws Exception
   {
      HttpClient client = new HttpClient();
      PostMethod method = new PostMethod(MessagingServiceMessagesURL);
      method.addRequestHeader(new Header("Authorization", "OpenId " + SubscriberOpenIdIdentifier));
      method.setRequestEntity(new StringRequestEntity("Hello !", "text/plain", "UTF-8"));
      int status = client.executeMethod(method);
      if (HttpResponseCodes.SC_OK != status) {
          throw new RuntimeException("Messages can not be sent");
      }
   }
View Full Code Here

      int status = client.executeMethod(method);
      Assert.assertEquals(200, status);
      String str = method.getResponseBodyAsString();

      PutMethod put = createPutMethod("/atom/feed");
      put.setRequestEntity(new StringRequestEntity(str, MediaType.APPLICATION_ATOM_XML, null));
      status = client.executeMethod(put);
      Assert.assertEquals(204, status);

   }
View Full Code Here

      int status = client.executeMethod(method);
      Assert.assertEquals(200, status);
      String str = method.getResponseBodyAsString();

      PutMethod put = createPutMethod("/atom/entry");
      put.setRequestEntity(new StringRequestEntity(str, MediaType.APPLICATION_ATOM_XML, null));
      status = client.executeMethod(put);
      Assert.assertEquals(204, status);
   }
View Full Code Here

         Assert.assertEquals("basic", method.getResponseBodyAsString());
         method.releaseConnection();
      }
      {
         PutMethod method = createPutMethod("/basic");
         method.setRequestEntity(new StringRequestEntity("basic", "text/plain", null));
         int status = client.executeMethod(method);
         Assert.assertEquals(204, status);
         method.releaseConnection();
      }
      {
View Full Code Here

         Assert.assertEquals("basic", method.getResponseBodyAsString());
         method.releaseConnection();
      }
      {
         PutMethod method = createPutMethod("/locating/basic");
         method.setRequestEntity(new StringRequestEntity("basic", "text/plain", null));
         int status = client.executeMethod(method);
         Assert.assertEquals(204, status);
         method.releaseConnection();
      }
      {
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.methods.StringRequestEntity

Copyright © 2018 www.massapicom. 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.