Examples of YokeTester


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

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

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

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

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

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

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

        // application/json
        // text/xml
        // text/html
        // text/plain

        new YokeTester(yoke).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                assertEquals(resp.body.toString(), "text/xml");
                testComplete();
View Full Code Here

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

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("x-forward-for", "123.456.123.456, 111.111.11.11");

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

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

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept-Language", "en-gb;q=0.8, en;q=0.7, da_DK;q=0.9");

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

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

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept-Language", "da, en-gb;q=0.8, en;q=0.7");

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

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

        // second time send the authorization header
        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Accept-Language", "en-gb");

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

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

    public void testStaticSimple() {

        Yoke yoke = new Yoke(this);
        yoke.use(new Static("static"));

        new YokeTester(yoke).request("GET", "/dir1/file.1", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

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

    public void testStaticSimpleNotFound() {

        Yoke yoke = new Yoke(this);
        yoke.use(new Static("static"));

        new YokeTester(yoke).request("GET", "/dir1/file.2", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(404, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

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

    // TODO: wait for bugfix from Vert.x 2.1.2
    public void testStaticEscape() {
        Yoke yoke = new Yoke(this);
        yoke.use(new Static("static"));

        new YokeTester(yoke).request("GET", "/dir1/new%20file.1", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                testComplete();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.