Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.ClientResponse.releaseConnection()


         request = new ClientRequest(shoppingLinks.get("customers").getHref());
         request.body("application/xml", customer);
         response = request.post();
         Assert.assertEquals(201, response.getStatus());
         String uri = (String) response.getHeaders().getFirst("Location");
         response.releaseConnection();
        
         request = new ClientRequest(uri);
         customer = request.getTarget(Customer.class);
      }
View Full Code Here


      order.getLineItems().add(item);
      request = new ClientRequest(shoppingLinks.get("orders").getHref());
      request.body("application/xml", order);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      response.releaseConnection();

      System.out.println();
      System.out.println("** Show all orders.");
      request = new ClientRequest(shoppingLinks.get("orders").getHref());
      String xml = request.getTarget(String.class);
View Full Code Here

   public void testPopulateDB() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ex11_1/services/shop");
      ClientResponse response = request.head();
      Map<String, Link> shoppingLinks = processLinkHeaders(response);
      response.releaseConnection();

      System.out.println("** Populate Products");
      request = new ClientRequest(shoppingLinks.get("products").getHref());

      Product product = new Product();
View Full Code Here

      product.setName("iPhone");
      product.setCost(199.99);
      request.body("application/xml", product);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      response.releaseConnection();

      product = new Product();
      product.setName("MacBook Pro");
      product.setCost(3299.99);
      request.body("application/xml", product);
View Full Code Here

      product.setName("MacBook Pro");
      product.setCost(3299.99);
      request.body("application/xml", product);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      response.releaseConnection();

      product = new Product();
      product.setName("iPod");
      product.setCost(49.99);
      request.body("application/xml", product);
View Full Code Here

      product.setName("iPod");
      product.setCost(49.99);
      request.body("application/xml", product);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      response.releaseConnection();
   }

   @Test
   public void testCreateOrder() throws Exception
   {
View Full Code Here

   public void testCreateOrder() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ex11_1/services/shop");
      ClientResponse response = request.head();
      Map<String, Link> shoppingLinks = processLinkHeaders(response);
      response.releaseConnection();

      System.out.println("** Buy an iPhone for Bill Burke");
      System.out.println();
      System.out.println("** First see if Bill Burke exists as a customer");
      request = new ClientRequest(shoppingLinks.get("customers").getHref() + "?firstName=Bill&lastName=Burke");
View Full Code Here

         request = new ClientRequest(shoppingLinks.get("customers").getHref());
         request.body("application/xml", customer);
         response = request.post();
         Assert.assertEquals(201, response.getStatus());
         String uri = (String) response.getHeaders().getFirst("Location");
         response.releaseConnection();
        
         request = new ClientRequest(uri);
         customer = request.getTarget(Customer.class);
      }
View Full Code Here

      order.getLineItems().add(item);
      request = new ClientRequest(shoppingLinks.get("orders").getHref());
      request.body("application/xml", order);
      response = request.post();
      Assert.assertEquals(201, response.getStatus());
      response.releaseConnection();

      System.out.println();
      System.out.println("** Show all orders.");
      request = new ClientRequest(shoppingLinks.get("orders").getHref());
      String xml = request.getTarget(String.class);
View Full Code Here

         */

         ClientRequest request = new ClientRequest(u, executor);
         request.body("application/xml", itemString);
         ClientResponse response = request.post();
         response.releaseConnection();
         Assert.assertEquals(202, response.getStatus());


      }
      latch.await(10, TimeUnit.SECONDS);
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.