Package org.springmodules.validation.util.date

Examples of org.springmodules.validation.util.date.DefaultDateParser



    public void testParser19Dates1() throws DateParseException {
        String text =
            "{ dateOfBirth : dateOfBirth >= [1970-01-01] : 'You must be born after 1 january 1970.' }";
        assertTrue(validate(new Person(new DefaultDateParser().parse("1974-11-24")), text));
        assertFalse(validate(new Person(new DefaultDateParser().parse("1950-07-14")), text));
    }
View Full Code Here


    }

    public void testParser20Dates2() throws DateParseException {
        String text =
            "{ dateOfBirth : ? is null or (dateOfBirth >= [T<d] and [T>d] > dateOfBirth) : 'You must be born today.' }";
        assertTrue(validate(new Person(new DefaultDateParser().parse("T")), text));
        assertFalse(validate(new Person(new DefaultDateParser().parse("T-1d")), text));
    }
View Full Code Here

TOP

Related Classes of org.springmodules.validation.util.date.DefaultDateParser

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.