Package javax.ws.rs.core

Examples of javax.ws.rs.core.Response


   public void invoke(HttpRequest request, HttpResponse response, ResourceInvoker invoker)
   {
      try
      {
         pushContextObjects(request, response);
         Response jaxrsResponse = getResponse(request, response, invoker);

         try
         {
            if (jaxrsResponse != null) writeJaxrsResponse(request, response, jaxrsResponse);
         }
View Full Code Here


   }

   protected Response getResponse(HttpRequest request, HttpResponse response,
                                  ResourceInvoker invoker)
   {
      Response jaxrsResponse = null;
      try
      {
         jaxrsResponse = invoker.invoke(request, response);
         if (request.isSuspended())
         {
View Full Code Here

      List<String> cookies = Arrays.asList(nck1.toString().toLowerCase(),
              nck2.toString().toLowerCase(),
              nck3.toString().toLowerCase());

      Response resp = Response.status(status).cookie(nck1, nck2, nck3).build();
      String tmp = verifyResponse(resp, null, status, null, null, null, null,
              null, cookies);
      if (tmp.endsWith("false"))
      {
         pass = false;
View Full Code Here

      Cookie ck1 = new Cookie(name, value);
      NewCookie nck1 = new NewCookie(ck1);

      List<String> cookies = Arrays.asList(nck1.toString().toLowerCase());

      Response resp = Response.status(status).header("Content-type",
              "text/plain").header("Content-type", "text/html").header("Content-Language", "en_US").
              header("Content-Language", "en_GB").header("Content-Language",
              "zh_CN").header("Cache-Control", "no-transform").
              header("Set-Cookie", "name_1=value_1;version=1").build();
      String tmp = verifyResponse(resp, null, status, encoding, lang, type,
View Full Code Here

   }

   @Test
   public void testLocationSimple()
   {
      Response r = builder.location(URI.create("/res")).build();
      String actualUri = r.getMetadata().getFirst("Location").toString();

      Assert.assertEquals("http://localhost/res", actualUri);
   }
View Full Code Here

   }

   @Test
   public void testLocationPath()
   {
      Response r = builder.location(URI.create("/a/res")).build();
      String actualUri = r.getMetadata().getFirst("Location").toString();

      Assert.assertEquals("http://localhost/a/res", actualUri);
   }
View Full Code Here

   }

   @Test
   public void testLocationQueryString()
   {
      Response r = builder.location(URI.create("/res?query")).build();
      String actualUri = r.getMetadata().getFirst("Location").toString();

      Assert.assertEquals("http://localhost/res?query", actualUri);
   }
View Full Code Here

   }

   @Test
   public void testLocationFragment()
   {
      Response r = builder.location(URI.create("/res#frag")).build();
      String actualUri = r.getMetadata().getFirst("Location").toString();

      Assert.assertEquals("http://localhost/res#frag", actualUri);
   }
View Full Code Here

   }

   @Test
   public void testContentLocationSimple()
   {
      Response r = builder.contentLocation(URI.create("/res")).build();
      String actualUri = r.getMetadata().getFirst("Content-Location").toString();

      Assert.assertEquals("http://localhost/res", actualUri);
   }
View Full Code Here

   }

   @Test
   public void testContentLocationPath()
   {
      Response r = builder.contentLocation(URI.create("/a/res")).build();
      String actualUri = r.getMetadata().getFirst("Content-Location").toString();

      Assert.assertEquals("http://localhost/a/res", actualUri);
   }
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.Response

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.