Package org.mojavemvc.core

Examples of org.mojavemvc.core.MojaveRoute


        assertTrue(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void toString_NoController_NoAction_NoParamPath() {
        MojaveRoute r = new MojaveRoute(null, null, null);
        String expected = "/";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here


        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_WithController_NoAction_NoParamPath() {
        MojaveRoute r = new MojaveRoute("cntrl", null, null);
        String expected = "/cntrl";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_WithController_WithAction_NoParamPath() {
        MojaveRoute r = new MojaveRoute("cntrl", "actn", null);
        String expected = "/cntrl/actn";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_NoController_WithAction_NoParamPath() {
        MojaveRoute r = new MojaveRoute(null, "actn", null);
        String expected = "/actn";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_WithController_WithAction_WithParamPath() {
        MojaveRoute r = new MojaveRoute("cntrl", "actn", "clients/:id");
        String expected = "/cntrl/actn/clients/:id";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_NoController_WithAction_WithParamPath() {
        MojaveRoute r = new MojaveRoute(null, "actn", "clients/:id");
        String expected = "/actn/clients/:id";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_WithController_NoAction_WithParamPath() {
        MojaveRoute r = new MojaveRoute("cntrl", null, "clients/:id");
        String expected = "/cntrl/clients/:id";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void toString_NoController_NoAction_WithParamPath() {
        MojaveRoute r = new MojaveRoute(null, null, "clients/:id");
        String expected = "/clients/:id";
        String actual = r.toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void pathParameterElements_NoneExist() {
        MojaveRoute r = new MojaveRoute(null, "actn", null);
        List<NamedParameterElement> params = r.getNamedParameterElements();
        assertTrue(params.isEmpty());
    }
View Full Code Here

        assertTrue(params.isEmpty());
    }
   
    @Test
    public void pathParameterElements_OneExistsWithAction() {
        MojaveRoute r = new MojaveRoute(null, "actn", ":id");
        List<NamedParameterElement> params = r.getNamedParameterElements();
        assertEquals(1, params.size());
        NamedParameterElement elem = params.get(0);
        assertEquals("id", elem.name());
        assertEquals(1, elem.index());
    }
View Full Code Here

TOP

Related Classes of org.mojavemvc.core.MojaveRoute

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.