Package org.grails.web.mapping

Examples of org.grails.web.mapping.DefaultUrlMappingData


*        Time: 7:50:41 AM
*/
public class UrlMappingDataTests extends TestCase {

    public void testOptionals() {
        UrlMappingData data = new DefaultUrlMappingData("/surveys/(*)?");

        assertEquals(2, data.getTokens().length);
        assertTrue(data.isOptional(0));
    }
View Full Code Here


        assertEquals(2, data.getTokens().length);
        assertTrue(data.isOptional(0));
    }

    public void testTokens() {
        UrlMappingData data = new DefaultUrlMappingData("/blog/(*)/2007/(*)?");

        String[] tokens = data.getTokens();

        assertFalse(tokens.length == 0);

        assertEquals("blog",tokens[0]);
        assertEquals("(*)",tokens[1]);
        assertEquals("2007",tokens[2]);
        assertEquals("(*)?",tokens[3]);

        assertFalse(data.isOptional(0));
        assertTrue(data.isOptional(1));
    }
View Full Code Here

        assertFalse(data.isOptional(0));
        assertTrue(data.isOptional(1));
    }

    public void testLogicalUrls() {
        UrlMappingData data = new DefaultUrlMappingData("/blog/(*)?/2007/*/*?");

        String[] urls = data.getLogicalUrls();

        assertEquals(3, urls.length);

        assertEquals("/blog/(*)?/2007/*/*?", urls[0]);
        assertEquals("/blog/(*)?/2007/*", urls[1]);
View Full Code Here

TOP

Related Classes of org.grails.web.mapping.DefaultUrlMappingData

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.