Package org.jboss.resteasy.client

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


      contentSignature.setPrivateKey(keys.getPrivate());
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());
      response.releaseConnection();

   }

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


      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(204, response.getStatus());
      response.releaseConnection();

   }

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

      contentSignature.setPrivateKey(badKey);
      request.header(DKIMSignature.DKIM_SIGNATURE, contentSignature);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
      response.releaseConnection();
   }

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

   {
      ClientRequest request = new ClientRequest(TestPortProvider.generateURL("/signed"), executor);
      request.body("text/plain", "hello world");
      ClientResponse response = request.post();
      Assert.assertEquals(401, response.getStatus());
      response.releaseConnection();
   }

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

         System.out.println("get");
         response = request.get();
         Assert.assertEquals(200, response.getStatus());
         //Assert.assertEquals("hello world", response.getEntity(String.class));
         System.out.println("ok");
         if (release) response.releaseConnection();
      }
      catch (Exception e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

   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());

      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-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();
      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

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.