Package org.jboss.resteasy.client.jaxrs

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


      dataStore.saveDocument( new EntitiesDesignDocument() );
    }

    Client client = ClientBuilder.newBuilder().build();
    WebTarget target = client.target( dataStore.getDatabaseIdentifier().getDatabaseUri() );
    ResteasyWebTarget rtarget = (ResteasyWebTarget) target;

    return rtarget.proxy( DatabaseTestClient.class );
  }
View Full Code Here


   @Test
   public void testBasic() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/test"));
      String val = target.request().get(String.class);
      Assert.assertEquals("hello world", val);
   }
View Full Code Here

   @Test
   public void testUnhandledException() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/exception"));
      Response resp = target.request().get();
      Assert.assertEquals(500, resp.getStatus());
   }
View Full Code Here

   }

    @Test
    public void testChannelContext() throws Exception {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/context"));
      String val = target.request().get(String.class);
      Assert.assertNotNull(val);
      Assert.assertFalse(val.isEmpty());
    }
View Full Code Here

      return auth;
   }

   public SkeletonKeyAdminClient admin()
   {
      ResteasyWebTarget clone = admin.clone();
      Mappers.registerContextResolver(clone);
      authenticateTarget("Skeleton Key", clone);
      return clone.proxy(SkeletonKeyAdminClient.class);
   }
View Full Code Here

   }

   @Override
   protected WebTarget apply(WebTarget target, Object object)
   {
      ResteasyWebTarget t = (ResteasyWebTarget)target;
      return t.queryParamNoTemplate(paramName, object);
   }
View Full Code Here

   @Test
   public void testCase2() throws Exception
   {

      ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/test/string"));
      Customer cust = new Customer();
      String name = "bill\u00E9";
      cust.setName(name);
      Response response = target.request().post(Entity.xml(cust));
      response.close();
   }
View Full Code Here

   }

   @Test
   public void testCase() throws Exception
   {
      ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/test"));
      Customer cust = new Customer();
      String name = "bill\u00E9";
      System.out.println("client name: " + name);

      System.out.println("bytes string: " + new String(name.getBytes("UTF-8"), "UTF-8"));
      cust.setName(name);
      Response response = target.request().post(Entity.xml(cust));
      response.close();
   }
View Full Code Here

   @Test
   public void testXmlRootElement() throws Exception
   {
      before();
      ResteasyWebTarget target = client.target(generateURL("/xmlRootElement"));
      FavoriteMovieXmlRootElement movie = new FavoriteMovieXmlRootElement();
      movie.setTitle("La Regle du Jeu");
      Response response = target.request().post(Entity.entity(movie,"application/xml"));
      Assert.assertEquals(200, response.getStatus());
      String entity = response.readEntity(String.class);
      System.out.println("Result: " + entity);
      Assert.assertEquals("La Regle du Jeu", entity);
   }
View Full Code Here

   public void testNakedArray() throws Exception
   {
      String xml = "<resteasy:collection xmlns:resteasy=\"http://jboss.org/resteasy\">"
              + "<foo test=\"hello\"/></resteasy:collection>";

      ResteasyWebTarget target = client.target(generateURL("/array"));
      Response response = target.request().post(Entity.xml(xml));
      List<Foo> list = response.readEntity(new GenericType<List<Foo>>()
      {
      });
      Assert.assertEquals(1, list.size());
      Assert.assertEquals(list.get(0).getTest(), "hello");
View Full Code Here

TOP

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

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.