Package org.jboss.resteasy.client.jaxrs

Examples of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder


   }

   @Test
   public void testMe() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(generateURL("/datetest/04-23-1977")).request();
      System.out.println(request.get(String.class));
      client.close();
   }
View Full Code Here


   }

   @Test
   public void testMe2() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(generateURL("/fromstring/ORANGE/football")).request();
      System.out.println(request.get(String.class));
      client.close();
   }
View Full Code Here

    * Verifies that a more specific media type is preferred.
    */
   @Test
   public void testVariant() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(TestPortProvider.generateURL("/variant")).request();
      request.accept(MediaType.WILDCARD_TYPE);
      request.accept(MediaType.TEXT_HTML_TYPE);
      Response response = request.get();
      Assert.assertEquals(200, response.getStatus());
View Full Code Here

    * Verifies that the number of parameters does not outweigh more specific media types.
    */
   @Test
   public void testVariantWithParameters() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(TestPortProvider.generateURL("/params")).request();
      request.accept(WILDCARD_WITH_PARAMS);
      request.accept(MediaType.TEXT_HTML_TYPE);
      Response response = request.get();
      Assert.assertEquals(200, response.getStatus());
View Full Code Here

   /**
    * ... here it doesn't work
    */
   @Test
   public void testNewBuilder() {
      ApiService apiService = new ResteasyClientBuilder().build().target(TEST_URI).proxy(ApiService.class);
      tryCall(apiService);
   }
View Full Code Here


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

    * @throws Exception
    */
   @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");
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

   public void test6() throws Exception
   {

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

TOP

Related Classes of org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder

Copyright © 2018 www.massapicom. 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.