Package com.firefly.server.http

Examples of com.firefly.server.http.HttpServletRequestImpl


    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getMethod(), is("GET"));
    Assert.assertThat(req.getRequestURI(), is("/firefly-demo/app/hello"));
    Assert.assertThat(req.getProtocol(), is("HTTP/1.1"));
  }
View Full Code Here


    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getMethod(), is("GET"));
    Assert.assertThat(req.getRequestURI(), is("/firefly-demo/app/hello"));
    Assert.assertThat(req.getProtocol(), is("HTTP/1.1"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getMethod(), is("GET"));
    Assert.assertThat(req.getRequestURI(), is("/firefly-demo/app/hello"));
    Assert.assertThat(req.getProtocol(), is("HTTP/1.1"));
    Assert.assertThat(req.getQueryString(), is("query=3.3&test=4"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getHeader("host"), is("127.0.0.1"));
    Assert.assertThat(req.getHeader("Host"), is("127.0.0.1"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getHeader("host"), is("127.0.0.1"));
    Assert.assertThat(req.getHeader("connection"), is("keep-alive"));
    Assert.assertThat(req.getHeader("Accept-Language"),
        is("zh-CN,zh;q=0.8"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getHeader("host"), is("127.0.0.1"));
    Assert.assertThat(req.getHeader("connection"), is("keep-alive"));
    Assert.assertThat(req.getHeader("Accept-Language"),
        is("zh-CN,zh;q=0.8"));
    Assert.assertThat(req.getHeader("Accept-Encoding"),
        is("gzip,deflate,sdch"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getMethod(), is("GET"));
    Assert.assertThat(req.getRequestURI(), is("/firefly-demo/app/hello"));
    Assert.assertThat(req.getProtocol(), is("HTTP/1.1"));
    Assert.assertThat(req.getHeader("host"), is("127.0.0.1"));
    Assert.assertThat(req.getHeader("connection"), is("keep-alive"));
    Assert.assertThat(req.getHeader("Accept-Language"),
        is("zh-CN,zh;q=0.8"));
    Assert.assertThat(req.getHeader("Accept-Encoding"),
        is("gzip,deflate,sdch"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getParameter("title"), is("测试"));
    Assert.assertThat(req.getParameter("price"), is("3.3"));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }

    HttpServletRequestImpl req = session.request;
    Assert.assertThat(req.getParameter("title"), is("测试"));
    Assert.assertThat(req.getParameter("price"), is(""));
  }
View Full Code Here

    for (int i = 0; i < buf.length; i++) {
      httpDecoder.decode(buf[i], session);
    }
   
    HttpServletRequestImpl req = session.request;
    System.out.println(req.getParameter("title"));
    System.out.println(req.getLocale().toString());
    System.out.println(req.getRequestURL().toString());
    Assert.assertThat(req.getRequestURL().toString(), is("http://localhost/firefly-demo/app/hello"));
    Assert.assertThat(req.getLocale().toString(), is("zh_CN"));
    Assert.assertThat(req.getParameter("title"), is("测试"));
    Assert.assertThat(req.getParameter("price"), nullValue());
    Assert.assertThat(req.getContentLength(), is(24));
    Assert.assertThat(req.getContentType(),
        is("application/x-www-form-urlencoded"));
  }
View Full Code Here

TOP

Related Classes of com.firefly.server.http.HttpServletRequestImpl

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.