Package org.jboss.resteasy.client

Examples of org.jboss.resteasy.client.ClientRequest


public class EjbTest
{
   @Test
   public void testIt() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ejb-test/prefixed/scan");
      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("hello world", response.getEntity());

   }
View Full Code Here


   }

   @Test
   public void testException() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ejb-test/prefixed/scan/exception");
      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(412, response.getStatus());

      request = new ClientRequest("http://localhost:8080/ejb-test/prefixed/scan/custom-exception");
      response = request.get(String.class);
      Assert.assertEquals(412, response.getStatus());

      request = new ClientRequest("http://localhost:8080/ejb-test/prefixed/scan/ejb-exception");
      response = request.get(String.class);
      Assert.assertEquals(412, response.getStatus());
   }}
View Full Code Here

public class EjbTest
{
   @Test
   public void testIt() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ejb-test/scan");
      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("hello world", response.getEntity());

   }
View Full Code Here

   }

   @Test
   public void testException() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/ejb-test/scan/exception");
      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(412, response.getStatus());

      request = new ClientRequest("http://localhost:8080/ejb-test/scan/custom-exception");
      response = request.get(String.class);
      Assert.assertEquals(412, response.getStatus());

      request = new ClientRequest("http://localhost:8080/ejb-test/scan/ejb-exception");
      response = request.get(String.class);
      Assert.assertEquals(412, response.getStatus());
   }}
View Full Code Here

public class ScanningTest
{
   @Test
   public void testIt() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/scanned-test/scan");
      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("hello world", response.getEntity());

   }
View Full Code Here

   }

   @Test
   public void testScannedContextResolver() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/scanned-test/scan/resolver");
      String res = request.getTarget(String.class);
      Assert.assertEquals(res, "42");
   }
View Full Code Here


   @Test
   public void testItIntf() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/scanned-test/scan-intf");
      ClientResponse<String> response = request.get(String.class);
      Assert.assertEquals(200, response.getStatus());
      Assert.assertEquals("hello world", response.getEntity());

   }
View Full Code Here

   }

   @Test
   public void testScannedContextResolverIntf() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/scanned-test/scan-intf/resolver");
      String res = request.getTarget(String.class);
      Assert.assertEquals(res, "42");
   }
View Full Code Here

   }

   @Test
   public void testSingletons() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/application-scan-test/app-path/my/exception");
      ClientResponse response = request.get();
      Assert.assertEquals(412, response.getStatus());

      ClientRequest countRequest = new ClientRequest("http://localhost:8080/application-scan-test/app-path/my/exception/count");
      String res = countRequest.getTarget(String.class);
      Assert.assertEquals("1", res);

      request.clear();
      response = request.get();
      Assert.assertEquals(412, response.getStatus());

      countRequest.clear();
      res = countRequest.getTarget(String.class);
      Assert.assertEquals("1", res);
   }
View Full Code Here

   }

   @Test
   public void testSingletons() throws Exception
   {
      ClientRequest request = new ClientRequest("http://localhost:8080/application-config-test/my/exception");
      ClientResponse response = request.get();
      Assert.assertEquals(412, response.getStatus());

      ClientRequest countRequest = new ClientRequest("http://localhost:8080/application-config-test/my/exception/count");
      String res = countRequest.getTarget(String.class);
      Assert.assertEquals("1", res);

      request.clear();
      response = request.get();
      Assert.assertEquals(412, response.getStatus());

      countRequest.clear();
      res = countRequest.getTarget(String.class);
      Assert.assertEquals("1", res);
   }
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.client.ClientRequest

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.