Package org.xlightweb

Examples of org.xlightweb.IHttpRequestHandler


public final class HttpClientDoubleCacheHandlerTest  {

    @Test
    public void testGetWithExpireHeader() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                exchange.send(resp);
View Full Code Here


    @Test
    public void testSimple() throws Exception {
        System.out.println("testSimple");
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            @Supports100Continue
            public void onRequest(IHttpExchange exchange) throws IOException {
               
                IHttpRequest request = exchange.getRequest();
View Full Code Here

    @Test
    public void testSimple() throws Exception {
        System.out.println("testSimple");
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            @Supports100Continue
            public void onRequest(IHttpExchange exchange) throws IOException {
               
                IHttpRequest request = exchange.getRequest();
View Full Code Here

    @Test
    public void testSimple() throws Exception {
        System.out.println("testSimple");
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            @Supports100Continue
            public void onRequest(IHttpExchange exchange) throws IOException {
               
                IHttpRequest request = exchange.getRequest();
View Full Code Here

      };
      final IServer oldServer = new Server(dh);
      oldServer.start();
     
     
      IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
       
          public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
              HttpClientConnection con = new HttpClientConnection("localhost", oldServer.getLocalPort());
              IHttpResponse response = con.call(new GetRequest("http://localhost:" + oldServer.getLocalPort() + "/"));
             
View Full Code Here

      };
     
      final IServer server = new Server(dh);
      server.start();
     
      IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
         
          public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
             
              IHttpRequest request = exchange.getRequest();
              URL url = request.getRequestUrl();
View Full Code Here

  
  @Test
  public void testGetWithExpireHeader() throws Exception {
     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                exchange.send(resp);
View Full Code Here

 
  @Ignore
    @Test
    public void testGetWithExpireHeaderAndPOST() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                exchange.send(resp);
View Full Code Here

 

    @Test
    public void testGetWithExpireAndCacheControlHeader() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "Fri, 30 Oct 2011 14:19:41 GMT");
                resp.setHeader("Cache-Control", "public, max-age=21600");
View Full Code Here

   
   
    @Test
    public void testNegativeExpired() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Expires", "-1");
                exchange.send(resp);
View Full Code Here

TOP

Related Classes of org.xlightweb.IHttpRequestHandler

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.