Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.ClientRequest.body()


      Assert.assertEquals(200, response.getStatus());
      System.out.println(response.getEntity());
      response.releaseConnection();

      request = new ClientRequest(generateURL("/namespaced/array"));
      request.body("application/json", response.getEntity());
      response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      response.releaseConnection();
      System.out.println("done");
View Full Code Here


      Assert.assertEquals(200, response.getStatus());
      System.out.println(response.getEntity());
      response.releaseConnection();

      request = new ClientRequest(generateURL("/namespaced/list"));
      request.body("application/json", response.getEntity());
      response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      response.releaseConnection();

   }
View Full Code Here

   @Test
   public void testEmptyArray() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/empty/array"));
      request.body("application/json", "[]");
      ClientResponse<String> response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("[]", response.getEntity());
      response.releaseConnection();
View Full Code Here

   @Test
   public void testEmptyList() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/empty/list"));
      request.body("application/json", "[]");
      ClientResponse<String> response = request.post(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("[]", response.getEntity());
      response.releaseConnection();
View Full Code Here

      ClientRequest request = new ClientRequest(generateURL("/start"));
      String rtn = request.postTarget(String.class);
      Assert.assertEquals("started", rtn);

      request = new ClientRequest(generateURL("/start"));
      request.body("application/xml", "<xml/>");
      rtn = request.postTarget(String.class);
      Assert.assertEquals("<xml/>", rtn);

   }
View Full Code Here

   @Test
   public void testBadList() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/array"));
      request.body("application/json", "asdfasdfasdf");
      ClientResponse response = request.post();
      Assert.assertEquals(400, response.getStatus());
      response.releaseConnection();

   }
View Full Code Here

   public void test1() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/test1"));
      Foo foo = new Foo();
      foo.setName("Bill");
      request.body("application/xml", foo);
      ClientResponse res = request.post();
      Assert.assertEquals(res.getEntity(String.class), "Bill");

      request = new ClientRequest(generateURL("/test1"));
      res = request.post();
View Full Code Here

   public void test2() throws Exception
   {
      ClientRequest request = new ClientRequest(generateURL("/test2"));
      Foo foo = new Foo();
      foo.setName("Bill");
      request.body("application/xml", foo);
      ClientResponse res = request.post();
      Assert.assertEquals(res.getEntity(String.class), "Bill");

      request = new ClientRequest(generateURL("/test2"));
      res = request.post();
View Full Code Here

              + "<resteasy:entry key=\"monica\" xmlns=\"http://foo.com\">"
              + "<foo name=\"monica\"/></resteasy:entry>"
              + "</resteasy:map>";

      ClientRequest request = new ClientRequest(generateURL("/map"));
      request.body("application/xml", xml);
      ClientResponse<Map<String, Foo>> response = request.post(new GenericType<Map<String, Foo>>()
      {
      });
      Assert.assertEquals(200, response.getStatus());
      Map<String, Foo> map = response.getEntity();
View Full Code Here

      Assert.assertNotNull(map.get("monica"));
      Assert.assertEquals(map.get("bill").getName(), "bill");
      Assert.assertEquals(map.get("monica").getName(), "monica");

      request = new ClientRequest(generateURL("/map"));
      request.body("application/xml", xml);
      ClientResponse<String> response2 = request.post(String.class);
      System.out.println(response2.getEntity());


   }
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.