Package com.jetdrone.vertx.yoke.core

Examples of com.jetdrone.vertx.yoke.core.Context


    public void testContext118_1() {
        Map<String, Object> ro = new HashMap<String, Object>() {{
            put("title", "ro-title");
        }};

        Context ctx = new Context(ro);
        ctx.put("title", "rw-title");

        Set<String> keys = ctx.keySet();
        Set<String> expectedKeys = new HashSet<String>() {{
            add("title");
        }};

        assertEquals(expectedKeys, keys);
View Full Code Here


    public void testContext118_2() {
        Map<String, Object> ro = new HashMap<String, Object>() {{
            put("title", "ro-title");
        }};

        Context ctx = new Context(ro);
        ctx.put("title", "rw-title");

        Collection<Object> values = ctx.values();
        Collection<Object> expectedValues = new LinkedList<Object>() {{
            add("rw-title");
        }};

        assertEquals(expectedValues, values);
View Full Code Here

    public void testContext118_3() {
        Map<String, Object> ro = new HashMap<String, Object>() {{
            put("title", "ro-title");
        }};

        Context ctx = new Context(ro);
        ctx.put("title", "rw-title");

        Set<Map.Entry<String, Object>> entrySet = ctx.entrySet();
        assertEquals(1, entrySet.size());
    }
View Full Code Here

    public Yoke listen(final @NotNull HttpServer server) {
        server.requestHandler(new Handler<HttpServerRequest>() {
            @Override
            public void handle(HttpServerRequest req) {
                // the context map is shared with all middlewares
                final YokeRequest request = requestWrapper.wrap(req, new Context(defaultContext), engineMap, store);

                // add x-powered-by header is enabled
                Boolean poweredBy = request.get("x-powered-by");
                if (poweredBy != null && poweredBy) {
                    request.response().putHeader("x-powered-by", "yoke");
View Full Code Here

TOP

Related Classes of com.jetdrone.vertx.yoke.core.Context

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.