public void test_format_datevalue() {
assertEquals("2013-01-15", DateUtils.format(new DateValue("15", "1", "2013"), "yyyy-MM-dd"));
}
public void test___day_of_year() {
assertEquals(1, DateUtils.getDayOfYear(new DateValue("1", "1", "2011")));
assertEquals(2, DateUtils.getDayOfYear(new DateValue("2", "1", "2011")));
assertEquals(31, DateUtils.getDayOfYear(new DateValue("31", "1", "2011")));
assertEquals(32, DateUtils.getDayOfYear(new DateValue("1", "2", "2011")));
assertEquals(365, DateUtils.getDayOfYear(new DateValue("31", "12", "2011")));
assertEquals(366, DateUtils.getDayOfYear(new DateValue("31", "12", "2012"))); // 2012 is leap year
try {
DateUtils.getDayOfYear(new DateValue("32", "1", "2011"));
fail();
} catch (IllegalArgumentException e) {}
try {
DateUtils.getDayOfYear(new DateValue("29", "2", "2011")); // feb has 28 days in 2011
fail();
} catch (IllegalArgumentException e) {}
}