Package org.jboss.resteasy.client.jaxrs

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


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


      dispatcher.getRegistry().addPerRequestResource(ResourceQueryPrimitiveListDefaultOverride.class);
      dispatcher.getRegistry().addPerRequestResource(ResourceQueryPrimitiveArray.class);
      dispatcher.getRegistry().addPerRequestResource(ResourceQueryPrimitiveArrayDefault.class);
      dispatcher.getRegistry().addPerRequestResource(ResourceQueryPrimitiveArrayDefaultNull.class);
      dispatcher.getRegistry().addPerRequestResource(ResourceQueryPrimitiveArrayDefaultOverride.class);
      client = new ResteasyClientBuilder().build();
      resourceQueryPrimitives = ProxyBuilder.builder(IResourceQueryPrimitives.class, client.target(generateBaseUrl())).build();
      resourceQueryPrimitiveWrappers = ProxyBuilder.builder(IResourceQueryPrimitiveWrappers.class, client.target(generateBaseUrl())).build();
      resourceQueryPrimitiveList = ProxyBuilder.builder(IResourceQueryPrimitiveList.class, client.target(generateBaseUrl())).build();
      resourceQueryPrimitiveArray = ProxyBuilder.builder(IResourceQueryPrimitiveArray.class, client.target(generateBaseUrl())).build();
   }
View Full Code Here

      } else {
          executor = new URLConnectionEngine();
      }


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

   }

   @Test
   public void testMe() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/lang"));
      Invocation.Builder request = target.request().header("Accept-Language", "en-US;q=0,en;q=0.8,de-AT,de;q=0.9");
      Assert.assertEquals(request.get().getStatus(), 200);
      client.close();
View Full Code Here

   }

   @Test
   public void testMe() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      MyTest proxy = client.target(TestPortProvider.generateURL("")).proxy(MyTest.class);
      try
      {
         proxy.postIt("hello");
         Assert.fail();
View Full Code Here

   public static void before() throws Exception
   {
      dispatcher = EmbeddedContainer.start().getDispatcher();
            forwardingResource = new ForwardingResource();
            dispatcher.getRegistry().addSingletonResource(forwardingResource);
      client = new ResteasyClientBuilder().build();
   }
View Full Code Here

   @BeforeClass
   public static void setUp() throws Exception
   {
      addPerRequestResource(BookImpl.class);
      client = new ResteasyClientBuilder().build();
   }
View Full Code Here


   @Test
   public void testEcho()
   {
      ResteasyClient client = new ResteasyClientBuilder().build();

      ResourceInterface proxy = client.target(generateBaseUrl()).proxy(ResourceInterface.class);
      Assert.assertEquals("content", proxy.echo(null));
      client.close();
   }
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

    * @throws Exception
    */
   @Test
   public void testMultiValueParam() throws Exception
   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      ResteasyWebTarget target = client.target(generateURL("/myform/server"));
      Response response = target.request().get();
      int status = response.getStatus();
      Assert.assertEquals(200, status);
      boolean sv1 = false;
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.