Package org.jboss.resteasy.client.jaxrs

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


   }

   @Test
   public void testContext() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(TestPortProvider.generateURL("/super/test/BaseService")).request();
      Response response = request.get();
      System.out.println("status: " + response.getStatus());
      String s = response.readEntity(String.class);
      System.out.println("response: " + s);
      Assert.assertEquals(200, response.getStatus());
View Full Code Here


   }

   @Test
   public void testInheritedContextOneLevel() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(TestPortProvider.generateURL("/sub/test/SomeService")).request();
      Response response = request.get();
      System.out.println("status: " + response.getStatus());
      String s = response.readEntity(String.class);
      System.out.println("response: " + s);
      Assert.assertEquals(200, response.getStatus());
View Full Code Here

   }
  
   @Test
   public void testInheritedContextTwoLevels() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(TestPortProvider.generateURL("/subsub/test/SomeSubService")).request();
      Response response = request.get();
      System.out.println("status: " + response.getStatus());
      String s = response.readEntity(String.class);
      System.out.println("response: " + s);
      Assert.assertEquals(200, response.getStatus());
View Full Code Here

         {
            sb.append("0");
         }
         String body = sb.toString();

         ResteasyClient client = new ResteasyClientBuilder().httpEngine(executor).build();
         Response response = client.target(generateURL("/hello")).request().post(Entity.text(body));
         System.out.println("Received response");
         Assert.assertEquals(200, response.getStatus());
         Assert.assertEquals(body, response.readEntity(String.class));
         if (inMemory)
         {
View Full Code Here

   @Test
   public void testInvalidMediaTypes() throws Exception
   {
      before();
      ResteasyClient client = new ResteasyClientBuilder().build();
      Invocation.Builder request = client.target(TestPortProvider.generateURL("/test")).request();
      Foo foo = request.get(Foo.class);
      System.out.println("foo: " + foo);
      Assert.assertEquals(new Foo("abc"), foo);
      client.close();
      after();
   }
View Full Code Here

   }

   @Test
   public void testConnectionCleanupProxy() throws Exception
   {
      final ResteasyClient client = createEngine();
      final MyResource proxy = client.target("http://localhost:8081").proxy(MyResource.class);
      counter.set(0);


      Thread[] threads = new Thread[3];
View Full Code Here

   }

   @Test
   public void testConnectionCleanupErrorGC() throws Exception
   {
      final ResteasyClient client = createEngine();
      final MyResource proxy = client.target("http://localhost:8081").proxy(MyResource.class);
      counter.set(0);


      Thread[] threads = new Thread[3];
View Full Code Here

   }

   @Test
   public void testConnectionCleanupErrorNoGC() throws Exception
   {
      final ResteasyClient client = createEngine();
      final MyResource proxy = client.target("http://localhost:8081").proxy(MyResource.class);
      counter.set(0);


      Thread[] threads = new Thread[3];
View Full Code Here

      Assert.assertEquals(30l, counter.get());
   }

   @Test
   public void testConnectionWithRequestBody() throws InterruptedException {
       final ResteasyClient client = createEngine();
       final MyResource proxy = client.target("http://localhost:8081").proxy(MyResource.class);
       counter.set(0);

       Thread[] threads = new Thread[3];

View Full Code Here

      } else {
          executor = new URLConnectionEngine();
      }


      ResteasyClient client = new ResteasyClientBuilder().httpEngine(executor).build();
      return client;
   }
View Full Code Here

TOP

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

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.