Package org.mojavemvc.core

Examples of org.mojavemvc.core.MojaveRoute


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


*/
public class TestRoute {

    @Test
    public void equals_NotEqual() {
        MojaveRoute r1 = new MojaveRoute(null, null, null);
        MojaveRoute r2 = new MojaveRoute("cntrl", null, null);
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertFalse(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_NotEqual_WithController() {
        MojaveRoute r1 = new MojaveRoute("cntrl", null, null);
        MojaveRoute r2 = new MojaveRoute("cntrl2", null, null);
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertFalse(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_NotEqual_WithControllerAndAction() {
        MojaveRoute r1 = new MojaveRoute("cntrl", "actn", null);
        MojaveRoute r2 = new MojaveRoute("cntrl", "actn2", null);
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertFalse(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_NotEqual_WithControllerAndActionAndParams() {
        MojaveRoute r1 = new MojaveRoute("cntrl", "actn", ":id");
        MojaveRoute r2 = new MojaveRoute("cntrl", "actn2", ":id");
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertFalse(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_NotEqual_WithControllerAndActionSameNames() {
        MojaveRoute r1 = new MojaveRoute("var", null, null);
        MojaveRoute r2 = new MojaveRoute(null, "var", null);
        assertFalse(r1.equals(r2));
        assertFalse(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertFalse(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_Equal_AllNull() {
        MojaveRoute r1 = new MojaveRoute(null, null, null);
        MojaveRoute r2 = new MojaveRoute(null, null, null);
        assertTrue(r1.equals(r2));
        assertTrue(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertTrue(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_Equal_WithController() {
        MojaveRoute r1 = new MojaveRoute("cntrl", null, null);
        MojaveRoute r2 = new MojaveRoute("cntrl", null, null);
        assertTrue(r1.equals(r2));
        assertTrue(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertTrue(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_Equal_WithControllerAndAction() {
        MojaveRoute r1 = new MojaveRoute("cntrl", "actn", null);
        MojaveRoute r2 = new MojaveRoute("cntrl", "actn", null);
        assertTrue(r1.equals(r2));
        assertTrue(r1.hashCode() == r2.hashCode());
    }
View Full Code Here

        assertTrue(r1.hashCode() == r2.hashCode());
    }
   
    @Test
    public void equals_Equal_WithControllerAndActionAndParams() {
        MojaveRoute r1 = new MojaveRoute("cntrl", "actn", ":id");
        MojaveRoute r2 = new MojaveRoute("cntrl", "actn", ":id");
        assertTrue(r1.equals(r2));
        assertTrue(r1.hashCode() == r2.hashCode());
    }
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.