Package org.jboss.resteasy.client.jaxrs

Examples of org.jboss.resteasy.client.jaxrs.ResteasyClient.target()


   @Test
   public void testProxy() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateBaseUrl());
      IGZIP proxy = target.proxy(IGZIP.class);
      Assert.assertEquals("HELLO WORLD", proxy.getText());
      Assert.assertEquals("HELLO WORLD", proxy.getGzipText());

      // resteasy-651
View Full Code Here


   @Test
   public void testContentLength() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      {
         WebTarget target = client.target(TestPortProvider.generateURL("/text"));
         Response response = target.request().get();
         Assert.assertEquals("HELLO WORLD", response.readEntity(String.class));
         String cl = response.getHeaderString("Content-Length");
         if (cl != null)
         {
View Full Code Here

            // make sure the content length is greater than 11 because this will be a gzipped encoding
         Assert.assertTrue(response.getLength() > 11);
         }
      }
      {
         WebTarget target = client.target(TestPortProvider.generateURL("/bytes"));
         Response response = target.request().acceptEncoding("gzip").get();
         String cl = response.getHeaderString("Content-Length");
         if (cl != null)
         {
            // make sure the content length is greater than 11 because this will be a gzipped encoding
View Full Code Here

   @Test
   public void testRequestError() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      WebTarget target = client.target(TestPortProvider.generateURL("/error"));
      Response response = target.request().get();
      Assert.assertEquals(405, response.getStatus());
      client.close();

   }
View Full Code Here

   @Test
   public void testPutStream() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      WebTarget target = client.target(TestPortProvider.generateURL("/stream"));
      Response res = target.request().header("Content-Encoding", "gzip").put(Entity.text("hello world"));
      Assert.assertEquals(204, res.getStatus());
      client.close();
   }
View Full Code Here

   @Test
   public void testPutText() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      WebTarget target = client.target(TestPortProvider.generateURL("/text"));
      Response res = target.request().header("Content-Encoding", "gzip").put(Entity.text("hello world"));
      Assert.assertEquals(204, res.getStatus());
      client.close();
   }
View Full Code Here

      String[] Headers = {"list=abcdef"};//, "list=fedcba"};

      ResteasyClient client = new ResteasyClientBuilder().build();
      for (String header : Headers)
      {
         Invocation.Builder request = client.target(TestPortProvider.generateURL("/PathParamTest/a/b/c/d/e/f")).request();
         request.header("Accept", "text/plain");
         Response response = request.get();
         Assert.assertEquals(200, response.getStatus());
         Assert.assertEquals(header, response.readEntity(String.class));
      }
View Full Code Here

   @Test
   public void testRequest() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      WebTarget target = client.target(TestPortProvider.generateURL("/text"));
      String val = target.request().get(String.class);
      Assert.assertEquals("HELLO WORLD", val);
      client.close();

   }
View Full Code Here

   @Test
   public void test178() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      {
         Invocation.Builder request = client.target(TestPortProvider.generateURL("/digits/5150")).request();
         Response response = request.get();
         Assert.assertEquals(200, response.getStatus());
         response.close();
      }
     
View Full Code Here

   @Test
   public void testRequest2() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      WebTarget target = client.target(TestPortProvider.generateURL("/encoded/text"));
      Response response = target.request().get();
      Assert.assertEquals("HELLO WORLD", response.readEntity(String.class));
      client.close();

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