Examples of ResteasyClient


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

   }

   @Test
   public void testClientResponse() throws Exception
   {
      ResteasyClient resteasyClient = new ResteasyClientBuilder().build();
      Client client = ProxyBuilder.builder(Client.class, resteasyClient.target(generateBaseUrl())).build();

      Assert.assertEquals("hello", client.getAsString());
      Response is = client.getAsInputStream();
      Assert.assertEquals("hello", new String(ReadFromStream.readFromStream(
              1024, is.readEntity(InputStream.class))));
      is.close();
      client.postString("new value");
      Assert.assertEquals("new value", client.getAsString());
      client.postInputStream(new ByteArrayInputStream("new value 2".getBytes()));
      Assert.assertEquals("new value 2", client.getAsString());
      resteasyClient.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.