Package org.jboss.resteasy.client.jaxrs

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


    * @throws Exception
    */
   @Test
   public void testProxy691() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateBaseUrl());
      MyFormProxy proxy = target.proxy(MyFormProxy.class);
      proxy.post(null);
      client.close();
   }
View Full Code Here


   }

   @Test
   public void testProxy() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateBaseUrl());
      FormClientProxy proxy = target.proxy(FormClientProxy.class);
      ClientForm form = new ClientForm();
      form.setBooleanValue(true);
      form.setName("This is My Name");
View Full Code Here

   }

   @Test
   public void lastModifiedTest() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/last"));
      Invocation.Builder request = target.request();
      Response response = request.get();
      System.out.println("status: " + response.getStatus());
      System.out.println("lastModified string: " + response.getHeaderString("last-modified"));
View Full Code Here

   @Test
   public void testFormResource() throws Exception
   {     
      InputStream in = null;
      ResteasyClient client = new ResteasyClientBuilder().build();
      try
      {
         ResteasyWebTarget target = client.target(TEST_URI);
         Invocation.Builder request = target.request();
         request.header("custom-header", "42");
View Full Code Here


   @Test
   public void testStreamStillOpen() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();

      final MyResource proxy = client.target( "http://localhost:8081").proxy(MyResource.class);
      boolean failed = true;
      try
      {
View Full Code Here

   @BeforeClass
   public static void setup() throws Exception
   {
      deployment = EmbeddedContainer.start();
      deployment.getRegistry().addPerRequestResource(TestResource.class);
      client = new ResteasyClientBuilder().build();
   }
View Full Code Here

    */
   @Test
   public void testApacheHttpClient4ExecutorNonSharedHttpClientFinalize() throws Throwable
   {
      ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine();
      ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
      Response response = client.target(generateURL("/test")).request().post(null);
      Assert.assertEquals(204, response.getStatus());
      engine.finalize();
      HttpClient httpClient = engine.getHttpClient();
      HttpPost post = new HttpPost(generateURL("/test"));
View Full Code Here

    */
   @Test
   public void testApacheHttpClient4ExecutorNonSharedHttpClientClose() throws Throwable
   {
      ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine();
      ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
      Response response = client.target(generateURL("/test")).request().post(null);
      Assert.assertEquals(204, response.getStatus());
      engine.close();
      HttpClient httpClient = engine.getHttpClient();
      HttpPost post = new HttpPost(generateURL("/test"));
View Full Code Here

   @Test
   public void testApacheHttpClient4ExecutorSharedHttpClientFinalize() throws Throwable
   {
      HttpClient httpClient = new DefaultHttpClient();
      ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpClient);
      ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
      Response response = client.target(generateURL("/test")).request().post(null);
      Assert.assertEquals(204, response.getStatus());
      engine.finalize();
      Assert.assertEquals(httpClient, engine.getHttpClient());
      HttpPost post = new HttpPost(generateURL("/test"));
View Full Code Here

   @Test
   public void testApacheHttpClient4ExecutorSharedHttpClientClose() throws Throwable
   {
      HttpClient httpClient = new DefaultHttpClient();
      ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpClient);
      ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
      Response response = client.target(generateURL("/test")).request().post(null);
      Assert.assertEquals(204, response.getStatus());
      engine.close();
      Assert.assertEquals(httpClient, engine.getHttpClient());
      HttpPost post = new HttpPost(generateURL("/test"));
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.