Code example for AssertionFailedError

Methods: getMessage

0
        checkShortParse("2001-5-30 +1 day",now,target,true);
        try { 
            checkShortParse("2001-5-30 +1 day",now,target,false);
            fail("Expected AssertionFailedError");
        } catch (AssertionFailedError pe) {
            if (pe.getMessage().startsWith("Expected AssertionFailedError")) { // don't swallow our failure
                throw pe;
            } 
        } 
        target.add(Calendar.WEEK_OF_YEAR, 1);
//        checkShortParse("2001-5-30 +1 week",now,target); 
//        target.add(Calendar.WEEK_OF_YEAR, 12); 
//        checkShortParse("2001-5-30 +13 weeks",now,target); 
//        target.add(Calendar.WEEK_OF_YEAR, 13); 
//        checkShortParse("2001-5-30 +26 weeks",now,target); 
    } 
 
    public void testParseShortFutureDates2() throws Exception { 
        GregorianCalendar now = new GregorianCalendar(2004, Calendar.AUGUST, 1, 12, 0);
        checkShortParse("2004-8-1",now,now); // should always work
        GregorianCalendar target = (GregorianCalendar) now.clone();