Examples of RouterHandler


Examples of org.eurekaj.manager.server.router.RouterHandler

            routes.put("startsWith:/alertRecipients", new AlertRecipientsHandler());
            routes.put("startsWith:/cachedScript", new CachedScriptHandler(webappDir));
            routes.put("equals:/", new CachedIndexHandler(webappDir, cacheSeconds));
            routes.put("equals:/index.html", new CachedIndexHandler(webappDir, cacheSeconds));
            
        routerHandler = new RouterHandler(routes, false,
          new CacheableFileServerHandler(
            webappDir,
            IntegerParser.parseIntegerFromString(System.getProperty("org.eurekaj.indexCacheSeconds"), 0)
          ));
        }
View Full Code Here

Examples of org.resthub.web.springmvc.router.support.RouterHandler

    @Then("^the request should be handled by \"([^\"]*)\"$")
    public void the_request_should_be_handled_by(String controllerAction) throws Throwable {

        assertThat(chain).isNotNull();
        RouterHandler handler = (RouterHandler) chain.getHandler();

        assertThat(handler).isNotNull();
        assertThat(handler.getRoute()).isNotNull();
        assertThat(handler.getRoute().action).isNotNull().isEqualToIgnoringCase(controllerAction);
    }
View Full Code Here

Examples of org.resthub.web.springmvc.router.support.RouterHandler

    @Then("^the handler should raise a security exception$")
    public void the_handler_should_raise_a_security_exception() throws Throwable {

        assertThat(chain).isNotNull();
        RouterHandler handler = (RouterHandler) chain.getHandler();

        Exception securityException = null;

        try {
            ha.handle(request, new MockHttpServletResponse(), handler);
View Full Code Here

Examples of org.resthub.web.springmvc.router.support.RouterHandler

    @Then("^the controller should respond with a ModelAndView containing:$")
    public void the_controller_should_respond_with_a_ModelAndView_containing(List<MaVParams> mavparams) throws Throwable {

        assertThat(chain).isNotNull();
        RouterHandler handler = (RouterHandler) chain.getHandler();

        ModelAndView mv = ha.handle(request, new MockHttpServletResponse(), handler);

        for (MaVParams param : mavparams) {
            assertThat(param.value).isEqualTo(mv.getModel().get(param.key).toString());
View Full Code Here

Examples of org.resthub.web.springmvc.router.support.RouterHandler

    }

    @Then("^the server should send an HTTP response with status \"([^\"]*)\"$")
    public void the_server_should_send_an_HTTP_response_with_status(int status) throws Throwable {

        RouterHandler handler = null;
        MockHttpServletResponse response = new MockHttpServletResponse();

        if(chain != null) {
            handler = (RouterHandler) chain.getHandler();
        }
View Full Code Here

Examples of se.cgbystrom.netty.http.router.RouterHandler

        LinkedHashMap<String, ChannelHandler> routes = new LinkedHashMap<String, ChannelHandler>();
        routes.put(startsWith, new SimpleResponseHandler(startsWith));
        routes.put(endsWith, new SimpleResponseHandler(endsWith));
        routes.put(equals, new SimpleResponseHandler(equals));

        startServer(new ChunkedWriteHandler(), new RouterHandler(routes));

        assertEquals(startsWith, get("/hello-world/not-used"));
        assertEquals(endsWith, get("/blah-blah/blah/the-very-end"));
        assertEquals(equals, get("/perfect-match"));
        assertFalse(equals.equals(get("/perfect-match/test", 404)));
View Full Code Here

Examples of se.cgbystrom.netty.http.router.RouterHandler

    @Test(expected=org.apache.commons.httpclient.NoHttpResponseException.class)
    public void routerSkip() throws Exception {
        LinkedHashMap<String, ChannelHandler> routes = new LinkedHashMap<String, ChannelHandler>();


        startServer(new ChunkedWriteHandler(), new RouterHandler(routes, false), new ChannelUpstreamHandler() {
            @Override
            public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception {
                if (e instanceof MessageEvent && ((MessageEvent)e).getMessage() instanceof HttpRequest) {
                    e.getChannel().close();
    }               return;
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.