Package com.jetdrone.vertx.yoke.test

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


                    request.put("blogs", blogs);
                    request.response().render("template2.hbs", next);
                }
            });

            new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
                @Override
                public void handle(Response resp) {
                    assertEquals(200, resp.getStatusCode());
                    assertEquals("<html><body><ul><li>Handlebars.java</li><li>Handlebars.js</li><li>Mustache</li></ul></body></html>", resp.body.toString());
                    testComplete();
View Full Code Here


            public void handle(YokeRequest request, Handler<Object> next) {
                request.response().render("views/home.hbs");
            }
        });

        new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                assertEquals("<h1>Yoke</h1>" + NEWLINE +
                        "<p>Home page</p>" + NEWLINE +
View Full Code Here

            public void handle(YokeRequest request, Handler<Object> next) {
                request.response().render("views/home2.hbs");
            }
        });

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

                        }
                )
                .listen(8080);


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

        });

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("host", "www.mycorp.com");

        new YokeTester(yoke).request("GET", "/", headers, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
            }
        });
    }
View Full Code Here

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

        final YokeTester tester = new YokeTester(yoke, false);

        vertx.setPeriodic(100, new Handler<Long>() {
            int i = 0;
            int some200 = 0;
            int some503 = 0;

            @Override
            public void handle(Long event) {
                tester.request("GET", "/", new Handler<Response>() {
                    @Override
                    public void handle(Response response) {
                        if (response.getStatusCode() == 200) {
                            some200++;
                        }
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", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                assertNotNull(resp.body);
                testComplete();
View Full Code Here

        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());
                assertNotNull(resp.body);
                testComplete();
View Full Code Here

        Buffer body = new Buffer("hello-world");

        MultiMap headers = new CaseInsensitiveMultiMap();
        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());
                assertNotNull(resp.body);
                testComplete();
View Full Code Here

            public void handle(YokeRequest request) {
                request.response().end();
            }
        });

        new YokeTester(yoke).request("DELETE", "/upload", 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.