use of java.util.GregorianCalendar in project j2objc by google.
the class DateTest method test_ConstructorIII.
/**
* java.util.Date#Date(int, int, int)
*/
public void test_ConstructorIII() {
// Test for method java.util.Date(int, int, int)
// the epoch + local time
Date d1 = new Date(70, 0, 1);
// the epoch + local time
Date d2 = new Date(0 + d1.getTimezoneOffset() * 60 * 1000);
assertTrue("Created incorrect date", d1.equals(d2));
Date date = new Date(99, 5, 22);
Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 22);
assertTrue("Wrong time zone", date.equals(cal.getTime()));
}
use of java.util.GregorianCalendar in project j2objc by google.
the class DateTest method test_setDateI.
/**
* java.util.Date#setDate(int)
*/
public void test_setDateI() {
// Test for method void java.util.Date.setDate(int)
Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9).getTime();
d.setDate(23);
assertEquals("Set incorrect date", 23, d.getDate());
}
use of java.util.GregorianCalendar in project j2objc by google.
the class DateTest method test_getYear.
/**
* java.util.Date#getYear()
*/
public void test_getYear() {
// Test for method int java.util.Date.getYear()
Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9).getTime();
assertEquals("Returned incorrect year", 98, d.getYear());
}
use of java.util.GregorianCalendar in project j2objc by google.
the class DateTest method test_setYearI.
/**
* java.util.Date#setYear(int)
*/
public void test_setYearI() {
// Test for method void java.util.Date.setYear(int)
Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9).getTime();
d.setYear(8);
assertEquals("Set incorrect year", 8, d.getYear());
}
use of java.util.GregorianCalendar in project j2objc by google.
the class DateTest method test_setMinutesI.
/**
* java.util.Date#setMinutes(int)
*/
public void test_setMinutesI() {
// Test for method void java.util.Date.setMinutes(int)
Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9).getTime();
d.setMinutes(45);
assertEquals("Set incorrect mins", 45, d.getMinutes());
}
Aggregations