Package org.jboss.resteasy.client

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


   public void testCreateCancelPurge() throws Exception
   {
      //RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
      String url = "http://localhost:8080/ex09_2/services/shop";
      ClientRequest request = new ClientRequest(url);
      ClientResponse response = request.head();
      Map<String, Link> shoppingLinks = processLinkHeaders(response);

      Link customers = shoppingLinks.get("customers");
      System.out.println("** Create a customer through this URL: " + customers.getHref());

View Full Code Here


   public void testCreateCancelPurge() throws Exception
   {
      //RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
      String url = "http://localhost:9095/shop";
      ClientRequest request = new ClientRequest(url);
      ClientResponse response = request.head();
      Map<String, Link> shoppingLinks = processLinkHeaders(response);

      Link customers = shoppingLinks.get("customers");
      System.out.println("** Create a customer through this URL: " + customers.getHref());

View Full Code Here

      response = request.get();
      System.out.println(response.getEntity(String.class));
      Map<String, Link> ordersLinks = processLinkHeaders(response);

      request = new ClientRequest(createdOrderUrl);
      response = request.head();
      Map<String, Link> orderLinks = processLinkHeaders(response);

      Link cancel = orderLinks.get("cancel");
      if (cancel != null)
      {
View Full Code Here

   @Test
   public void testPopulateDB() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ex11_1-war/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());
View Full Code Here

   @Test
   public void testCreateOrder() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ex11_1-war/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();
View Full Code Here

   @Test
   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());
View Full Code Here

   @Test
   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();
View Full Code Here

      response = request.get();
      System.out.println(response.getEntity(String.class));
      Map<String, Link> ordersLinks = processLinkHeaders(response);

      request = new ClientRequest(createdOrderUrl);
      response = request.head();
      Map<String, Link> orderLinks = processLinkHeaders(response);

      Link cancel = orderLinks.get("cancel");
      if (cancel != null)
      {
View Full Code Here

   @Test
   public void testHead() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/GetTest"));
      request.header("Accept", "text/plain");
      ClientResponse<?> response = request.head();
      Assert.assertEquals(200, response.getStatus());
      String header = response.getResponseHeaders().getFirst("CTS-HEAD");
      Assert.assertEquals("text-plain", header);
      response.releaseConnection();
   }
View Full Code Here

   @Test
   public void testHead2() throws Exception
   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/GetTest"));
      request.header("Accept", "text/html");
      ClientResponse<?> response = request.head();
      Assert.assertEquals(200, response.getStatus());
      String header = response.getResponseHeaders().getFirst("CTS-HEAD");
      Assert.assertEquals("text-html", header);
      response.releaseConnection();
   }
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.