Package org.xlightweb

Examples of org.xlightweb.IHttpRequestHandler


 
 
  @Test
    public void testRevalidate() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
                HttpResponse resp = new HttpResponse(200, "text/plain", "test");
                resp.setHeader("Cache-Control", "public, max-age=1000, must-revalidate");
                exchange.send(resp);
View Full Code Here


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

  
  @Test
  public void testPersistentRedirect() throws Exception {
     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {

                try {
                    HttpResponse resp = new HttpResponse(301);
View Full Code Here


    @Test
    public void testPersistentRedirectNoCache() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {

                try {
                    HttpResponse resp = new HttpResponse(301);
View Full Code Here

   
    @Test
    public void testNotFoundRedirectCached() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {

                try {
                    HttpResponse resp = new HttpResponse(302);
View Full Code Here


    @Test
    public void testNotFoundRedirectCachedAutohandled() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
   
                HttpResponse resp = null;
               
View Full Code Here

   
    @Test
    public void testSeeOtherTryCached() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {

                try {
                    HttpResponse resp = new HttpResponse(303);
View Full Code Here


    @Test
    public void testNotFoundRedirect() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
   
                try {
                    HttpResponse resp = new HttpResponse(302);
View Full Code Here


  @Test
  public void testETag() throws Exception {
     
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
               
                IHttpRequest request = exchange.getRequest();
                String ifNoneMatch = request.getHeader("If-None-Match");
View Full Code Here

    }  
   
    @Test
    public void testLastModification() throws Exception {
       
        IHttpRequestHandler reqHdl = new IHttpRequestHandler() {

            private final String date = HttpUtils.toRFC1123DateString(new Date());
           
            public void onRequest(IHttpExchange exchange) throws IOException, BadMessageException {
               
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.