Package org.apache.abdera.i18n.templates

Examples of org.apache.abdera.i18n.templates.Route.match()


        HashMapContext ctx = new HashMapContext();
        ctx.put("collection", "c");
        ctx.put("entry", "e");
        assertEquals("/c/e", route.expand(ctx));

        assertFalse(route.match("/foo"));
        assertTrue(route.match("/foo/test"));
        assertFalse(route.match("foo"));
        assertFalse(route.match("/foo/test/bar"));

        Map<String, String> vars = route.parse("/1/2");
View Full Code Here


        ctx.put("collection", "c");
        ctx.put("entry", "e");
        assertEquals("/c/e", route.expand(ctx));

        assertFalse(route.match("/foo"));
        assertTrue(route.match("/foo/test"));
        assertFalse(route.match("foo"));
        assertFalse(route.match("/foo/test/bar"));

        Map<String, String> vars = route.parse("/1/2");
        assertEquals("1", vars.get("collection"));
View Full Code Here

        ctx.put("entry", "e");
        assertEquals("/c/e", route.expand(ctx));

        assertFalse(route.match("/foo"));
        assertTrue(route.match("/foo/test"));
        assertFalse(route.match("foo"));
        assertFalse(route.match("/foo/test/bar"));

        Map<String, String> vars = route.parse("/1/2");
        assertEquals("1", vars.get("collection"));
        assertEquals("2", vars.get("entry"));
View Full Code Here

        assertEquals("/c/e", route.expand(ctx));

        assertFalse(route.match("/foo"));
        assertTrue(route.match("/foo/test"));
        assertFalse(route.match("foo"));
        assertFalse(route.match("/foo/test/bar"));

        Map<String, String> vars = route.parse("/1/2");
        assertEquals("1", vars.get("collection"));
        assertEquals("2", vars.get("entry"));
View Full Code Here

        ctx.put("collection", "c");
        ctx.put("entry", "e");
        ctx.put("foo", "f");
        assertEquals("c/e-f", route.expand(ctx));

        assertTrue(route.match("1/2-3"));
        assertFalse(route.match("1/2-"));
        assertFalse(route.match("1/-"));
    }

    @Test
View Full Code Here

        ctx.put("entry", "e");
        ctx.put("foo", "f");
        assertEquals("c/e-f", route.expand(ctx));

        assertTrue(route.match("1/2-3"));
        assertFalse(route.match("1/2-"));
        assertFalse(route.match("1/-"));
    }

    @Test
    public void testDashedRouteWithSubstitution() throws Exception {
View Full Code Here

        ctx.put("foo", "f");
        assertEquals("c/e-f", route.expand(ctx));

        assertTrue(route.match("1/2-3"));
        assertFalse(route.match("1/2-"));
        assertFalse(route.match("1/-"));
    }

    @Test
    public void testDashedRouteWithSubstitution() throws Exception {
        Map<String, String> defaults = new HashMap<String, String>();
View Full Code Here

        HashMapContext ctx = new HashMapContext();
        ctx.put("collection", "c");
        ctx.put("entry", "e");
        assertEquals("c/e-f", route.expand(ctx));

        assertTrue(route.match("1/2-3"));
        assertFalse(route.match("1/2-"));
        assertFalse(route.match("1/-"));
    }

    @Test
View Full Code Here

        ctx.put("collection", "c");
        ctx.put("entry", "e");
        assertEquals("c/e-f", route.expand(ctx));

        assertTrue(route.match("1/2-3"));
        assertFalse(route.match("1/2-"));
        assertFalse(route.match("1/-"));
    }

    @Test
    public void testBaseURI() throws Exception {
View Full Code Here

        ctx.put("entry", "e");
        assertEquals("c/e-f", route.expand(ctx));

        assertTrue(route.match("1/2-3"));
        assertFalse(route.match("1/2-"));
        assertFalse(route.match("1/-"));
    }

    @Test
    public void testBaseURI() throws Exception {
        Route route = new Route("entry", "/base/:collection/:entry");
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.