Package org.jboss.resteasy.client

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


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

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

View Full Code Here


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

      System.out.println("** Buy an iPhone for Bill Burke");
      System.out.println();
      System.out.println("** First see if Bill Burke exists as a customer");
View Full Code Here

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

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

View Full Code Here

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

      System.out.println("** Buy an iPhone for Bill Burke");
      System.out.println();
      System.out.println("** First see if Bill Burke exists as a customer");
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

      ClientRequest request = executor.createRequest(registration.getTarget().getHref());
      for (XmlHttpHeader header : registration.getHeaders())
      {
         request.header(header.getName(), header.getValue());
      }
     ClientResponse<?> res = request.head();
      if (res.getStatus() != 200)
      {
         throw new RuntimeException("Failed to query HornetQ REST destination for init information.  Status: " + res.getStatus());
      }
      String url = (String) res.getHeaders().getFirst("msg-create-with-id");
View Full Code Here

      ClientRequest request = executor.createRequest(registration.getTarget().getHref());
      for (XmlHttpHeader header : registration.getHeaders())
      {
         request.header(header.getName(), header.getValue());
      }
      ClientResponse<?> res = request.head();
      if (res.getStatus() != 200)
      {
         throw new RuntimeException("Failed to query HornetQ REST destination for init information.  Status: " + res.getStatus());
      }
      String url = (String)res.getHeaders().getFirst("msg-create-with-id");
View Full Code Here

   public void testTransform() throws Exception
   {

      ClientRequest request = new ClientRequest(generateURL("/queues/testQueue"));

      ClientResponse response = request.head();
      Assert.assertEquals(200, response.getStatus());
      Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create");
      System.out.println("create: " + sender);
      Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers");
      System.out.println("pull: " + consumers);
View Full Code Here

         session.start();


         ClientRequest request = new ClientRequest(generateURL("/queues/testQueue2"));

         ClientResponse response = request.head();
         Assert.assertEquals(200, response.getStatus());
         Link sender = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "create");
         System.out.println("create: " + sender);
         Link consumers = MessageTestBase.getLinkByTitle(manager.getQueueManager().getLinkStrategy(), response, "pull-consumers");
         System.out.println("pull: " + consumers);
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.