Package com.jetdrone.vertx.yoke.test

Examples of com.jetdrone.vertx.yoke.test.YokeTester


        // make a new request to / with cookie should return again the same cookie
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");

        new YokeTester(yoke).request("GET", "/", headers, null);
    }
View Full Code Here


                assertEquals("/pom.xml", request.normalizedPath());
                testComplete();
            }
        });

        new YokeTester(yoke).request("GET", "/./me/../pom.xml", null);
    }
View Full Code Here

                assertEquals("/", request.normalizedPath());
                testComplete();
            }
        });

        new YokeTester(yoke).request("GET", "/", null);
    }
View Full Code Here

                assertNull(request.normalizedPath());
                testComplete();
            }
        });

        new YokeTester(yoke).request("GET", "/%2e%2e%2f", null);
    }
View Full Code Here

                assertNull(request.normalizedPath());
                testComplete();
            }
        });

        new YokeTester(yoke).request("GET", "/%2e%2e/", null);
    }
View Full Code Here

                assertNull(request.normalizedPath());
                testComplete();
            }
        });

        new YokeTester(yoke).request("GET", "/..%2f", null);
    }
View Full Code Here

    MultiMap headers = new CaseInsensitiveMultiMap();
    headers.add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
    headers.add("Accept-Encoding", "gzip,deflate,sdch");

      new YokeTester(yoke).request("GET", "/", headers, new Handler<Response>() {
          @Override
          public void handle(Response resp) {
              assertEquals(200, resp.getStatusCode());
              for (int i = 0; i < resp.body.length(); i++) {
//                  System.out.println((int) resp.body.getByte(i));
View Full Code Here

        Yoke yoke = new Yoke(this);
        yoke.use(new com.jetdrone.vertx.yoke.middleware.Favicon());

        final Buffer icon = Utils.readResourceToBuffer(com.jetdrone.vertx.yoke.middleware.Favicon.class, "favicon.ico");

        new YokeTester(yoke).request("GET", "/favicon.ico", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                assertArrayEquals(icon.getBytes(), resp.body.getBytes());
                testComplete();
View Full Code Here

                request.response().end();
            }
        }));

        new YokeTester(yoke).request("GET", "/search/2012-07-14T00:00:00Z/2013-07-14T00:00:00Z", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());

                new YokeTester(yoke).request("GET", "/search/from/to", new Handler<Response>() {
                    @Override
                    public void handle(Response resp) {
                        assertEquals(400, resp.getStatusCode());
                        testComplete();
                    }
View Full Code Here

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("content-type", "application/json");
        headers.add("content-length", Integer.toString(body.length()));

        new YokeTester(yoke).request("POST", "/search/2012-07-14T00:00:00Z/2013-07-14T00:00:00Z", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

TOP

Related Classes of com.jetdrone.vertx.yoke.test.YokeTester

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.