Package org.jboss.resteasy.client

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


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

      product = new Product();
      product.setName("MacBook Pro");
      product.setCost(3299.99);
View Full Code Here


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

      product = new Product();
      product.setName("iPod");
      product.setCost(49.99);
View Full Code Here

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

   }

   @Test
View Full Code Here

   {
      ClientRequest request = new ClientRequest(generateURL("/array"));
      request.body("application/json", "asdfasdfasdf");
      ClientResponse response = request.post();
      Assert.assertEquals(400, response.getStatus());
      response.releaseConnection();

   }

   public static interface Store<T>
   {
View Full Code Here

public class SampleDataResourceClient {

    private static void checkAndReleaseConnection(Response response1) {
        ClientResponse response = (ClientResponse) response1;
        assertThat(response.getStatus(), Matchers.equalTo(200));
        response.releaseConnection();
    }

    private static ClientRequest createRequest(String path) {
        ClientRequest clientRequest =
                new ClientRequest(
View Full Code Here

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

      product = new Product();
      product.setName("MacBook Pro");
      product.setCost(3299.99);
View Full Code Here

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

      product = new Product();
      product.setName("iPod");
      product.setCost(49.99);
View Full Code Here

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

   }

   @Test
View Full Code Here

      contentSignature = new DKIMSignature(signatureHeader);
      Verification verification = new Verification(keys.getPublic());
      verification.setBodyHashRequired(false);
      verification.getRequiredAttributes().put("token", "1122");
      verification.verify(contentSignature, response.getResponseHeaders(), null, keys.getPublic());
      response.releaseConnection();
   }


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

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