Examples of RoutedRequest


Examples of org.mojavemvc.core.RoutedRequest

       
        String pathInfo = "/cntrl/actn/123";
        when(router.route(pathInfo))
            .thenReturn(new MojaveRoute("cntrl", "actn", ":id"));
       
        RoutedRequest routed = newRouter(pathInfo).route();
       
        assertEquals("cntrl", routed.getController());
        assertEquals("actn", routed.getAction());
        Map<String, Object> paramMap = routed.getParameterMap();
        Object val = paramMap.get("id");
        assertNotNull(val);
        assertArrayEquals(new String[]{"123"}, (String[])val);
    }
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

       
        String pathInfo = "/cntrl/actn/123/tom";
        when(router.route(pathInfo))
            .thenReturn(new MojaveRoute("cntrl", "actn", ":id/:name"));
       
        RoutedRequest routed = newRouter(pathInfo).route();
       
        assertEquals("cntrl", routed.getController());
        assertEquals("actn", routed.getAction());
        Map<String, Object> paramMap = routed.getParameterMap();
        Object val = paramMap.get("id");
        assertNotNull(val);
        assertArrayEquals(new String[]{"123"}, (String[])val);
        val = paramMap.get("name");
        assertNotNull(val);
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

        String pathInfo = "/cntrl/actn/123";
        when(router.route(pathInfo))
            .thenReturn(new MojaveRoute("cntrl", "actn", ":id"));
        paramMap.put("id", new String[]{"456"});
       
        RoutedRequest routed = newRouter(pathInfo).route();
       
        assertEquals("cntrl", routed.getController());
        assertEquals("actn", routed.getAction());
        Map<String, Object> paramMap = routed.getParameterMap();
        Object val = paramMap.get("id");
        assertNotNull(val);
        assertArrayEquals(new String[]{"123"}, (String[])val);
    }
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

        String pathInfo = "/cntrl/actn/123";
        when(router.route(pathInfo))
            .thenReturn(new MojaveRoute("cntrl", "actn", ":id"));
        paramMap.put("name", new String[]{"tom"});
       
        RoutedRequest routed = newRouter(pathInfo).route();
       
        assertEquals("cntrl", routed.getController());
        assertEquals("actn", routed.getAction());
        Map<String, Object> paramMap = routed.getParameterMap();
        Object val = paramMap.get("id");
        assertNotNull(val);
        assertArrayEquals(new String[]{"123"}, (String[])val);
        val = paramMap.get("name");
        assertNotNull(val);
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

        injector = Guice.createInjector(
                new ServletResourceModule(appProperties), new SomeModule());
        ServletResourceModule.set(req, res);

        routed = new RoutedRequest(null, null, parametersMap);
    }
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

    public void testInterceptors2() throws Exception {

        String methodName = "someAction";
        String action = "some-action";

        routed = new RoutedRequest(null, action, parametersMap);

        List<String> invocationList = new ArrayList<String>();
        InterceptedController2.invocationList = invocationList;
        Interceptor1.invocationList = invocationList;
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

    public void testInterceptors5() throws Exception {

        String methodName = "someAction";
        String action = "some-action";

        routed = new RoutedRequest(null, action, parametersMap);

        List<String> invocationList = new ArrayList<String>();
        InterceptedController4.invocationList = invocationList;
        Interceptor1.invocationList = invocationList;
        Interceptor1b.invocationList = invocationList;
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

    public void testInterceptors6() throws Exception {

        String methodName = "defaultAction";
        String action = "some-action";

        routed = new RoutedRequest(null, action, parametersMap);

        List<String> invocationList = new ArrayList<String>();
        InterceptedController4.invocationList = invocationList;
        Interceptor1.invocationList = invocationList;
        Interceptor1b.invocationList = invocationList;
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

    public void testInterceptors10() throws Exception {

        String methodName = "someAction";
        String action = "some-action";

        routed = new RoutedRequest(null, action, parametersMap);

        List<String> invocationList = new ArrayList<String>();
        InterceptedController5.invocationList = invocationList;
        Interceptor1.invocationList = invocationList;
        Interceptor1b.invocationList = invocationList;
View Full Code Here

Examples of org.mojavemvc.core.RoutedRequest

    public void testInterceptors14() throws Exception {

        String methodName = "someAction";
        String action = "some-action";

        routed = new RoutedRequest(null, action, parametersMap);

        List<String> invocationList = new ArrayList<String>();
        InterceptedController8.invocationList = invocationList;
        Interceptor1.invocationList = invocationList;
        Interceptor1b.invocationList = invocationList;
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.