Package org.bigtesting.routd

Examples of org.bigtesting.routd.RegexRoute


*/
public class TestRegexRoute {

    @Test
    public void pattern_NoController_NoAction_NoParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute(null, null, null));
        String expected = "^/$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here


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

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

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

        assertEquals(expected, actual);
    }
   
    @Test
    public void pattern_WithController_WithAction_WithParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute("cntrl", "actn", "clients/:id"));
        String expected = "^/cntrl/actn/clients/([^/]+)$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void pattern_NoController_WithAction_WithParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute(null, "actn", "clients/:id"));
        String expected = "^/actn/clients/([^/]+)$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void pattern_WithController_NoAction_WithParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute("cntrl", null, "clients/:id"));
        String expected = "^/cntrl/clients/([^/]+)$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void pattern_NoController_NoAction_WithParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute(null, null, "clients/:id"));
        String expected = "^/clients/([^/]+)$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void pattern_WithController_WithAction_WithRegexParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute("cntrl", "actn", "clients/:id<[0-9]+>"));
        String expected = "^/cntrl/actn/clients/([0-9]+)$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here

        assertEquals(expected, actual);
    }
   
    @Test
    public void pattern_WithController_WithAction_WithMultiRegexParamPath() {
        RegexRoute r = new RegexRoute(new MojaveRoute("cntrl", "actn", "clients/:id<[0-9]+>/:name"));
        String expected = "^/cntrl/actn/clients/([0-9]+)/([^/]+)$";
        String actual = r.pattern().toString();
        assertEquals(expected, actual);
    }
View Full Code Here

TOP

Related Classes of org.bigtesting.routd.RegexRoute

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.