Package org.jboss.example.jaxrs2.async

Examples of org.jboss.example.jaxrs2.async.Customer


      WebTarget target = client.target("http://localhost:9095/customers");
      Response response = target.queryParam("name", "Bill").request().get();
      try
      {
         Assert.assertEquals(200, response.getStatus());
         Customer cust = response.readEntity(Customer.class);
         Assert.assertEquals("Bill", cust.getName());
      }
      finally
      {
         response.close();
         client.close();
View Full Code Here


      Client client = ClientBuilder.newClient();
      WebTarget target = client.target("http://localhost:9095/customers");
      try
      {
         // extract customer directly expecting success
         Customer cust = target.queryParam("name", "Bill").request().get(Customer.class);
         Assert.assertEquals("Bill", cust.getName());
      }
      finally
      {
         client.close();
      }
View Full Code Here

      WebTarget target = client.target("http://localhost:9095/customers/{id}");
      Response response = target.resolveTemplate("id", "12345").request().get();
      try
      {
         Assert.assertEquals(200, response.getStatus());
         Customer cust = response.readEntity(Customer.class);
         Assert.assertEquals("Bill", cust.getName());
      }
      finally
      {
         response.close();
         client.close();
View Full Code Here

      try
      {
         // execute in background
         Future<Customer> future = target.queryParam("name", "Bill").request().async().get(Customer.class);
         // wait 10 seconds for a response
         Customer cust = future.get(10, TimeUnit.SECONDS);
         Assert.assertEquals("Bill", cust.getName());
      }
      finally
      {
         client.close();
      }
View Full Code Here

   {
      ResteasyClient client = new ResteasyClientBuilder().build();
      // or you can do...
      // ResteasyClient client = (ResteasyClient)ClientBuilder.newClient();
      CustomerProxy proxy = client.target("http://localhost:9095").proxy(CustomerProxy.class);
      Customer cust = proxy.getCustomer("Monica");
      Assert.assertEquals("Monica", cust.getName());
      client.close();
   }
View Full Code Here

TOP

Related Classes of org.jboss.example.jaxrs2.async.Customer

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.