Package org.bigtesting.routd

Examples of org.bigtesting.routd.NamedParameterElement


    @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


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

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

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

    @Test
    public void pathParameterElements_ManyExistWithRegexWithControllerAndAction() {
        MojaveRoute r = new MojaveRoute("cntrl", "actn", ":id<[0-9]+>/:name<[a-z]+>");
        List<NamedParameterElement> params = r.getNamedParameterElements();
        assertEquals(2, params.size());
        NamedParameterElement elem = params.get(0);
        assertEquals("id", elem.name());
        assertEquals(2, elem.index());
        elem = params.get(1);
        assertEquals("name", elem.name());
        assertEquals(3, elem.index());
    }
View Full Code Here

    @Test
    public void pathParameterElements_OneExistsWithRegexWithSlashWithControllerAndAction() {
        MojaveRoute r = new MojaveRoute("cntrl", "actn", ":id<[^/]+>/:name<[a-z]+>");
        List<NamedParameterElement> params = r.getNamedParameterElements();
        assertEquals(2, params.size());
        NamedParameterElement elem = params.get(0);
        assertEquals("id", elem.name());
        assertEquals(2, elem.index());
        elem = params.get(1);
        assertEquals("name", elem.name());
        assertEquals(3, elem.index());
    }
View Full Code Here

TOP

Related Classes of org.bigtesting.routd.NamedParameterElement

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.