use of jodd.datetime.JDateTime in project jodd by oblac.
the class JDateTimeConverterTest method testSqlTime2JDateTime.
@Test
public void testSqlTime2JDateTime() {
Time sqltime = new Time(time);
JDateTime jdt = jDateTimeConverter.convert(sqltime);
assertEquals(time, jdt.getTimeInMillis());
}
use of jodd.datetime.JDateTime in project jodd by oblac.
the class JDateTimeConverterTest method testCalendar2JDateTime.
@Test
public void testCalendar2JDateTime() {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(time);
JDateTime jdt = jDateTimeConverter.convert(calendar);
assertEquals(time, jdt.getTimeInMillis());
}
use of jodd.datetime.JDateTime in project jodd by oblac.
the class SqlTimeConverterTest method testJDateTime2Timestamp.
@Test
public void testJDateTime2Timestamp() {
JDateTime jdt = new JDateTime(time);
Time sqltime = sqlTimeConverter.convert(jdt);
assertEquals(time, sqltime.getTime());
}
use of jodd.datetime.JDateTime in project jodd by oblac.
the class TimeAfterConstraintTest method testIsValid.
@Test
public void testIsValid() {
JDateTime time = new JDateTime("2011-05-01 10:11:12.344");
TimeAfterConstraint constraint = new TimeAfterConstraint(time.clone());
assertFalse("result must be true when validate time which is equal to constraint time", constraint.isValid(mockContext(), time.clone()));
assertFalse("result must be false when validate time which is less than constraint time", constraint.isValid(mockContext(), time.clone().subMinute(1)));
assertTrue("result must be true when validate time which is greater than constraint time", constraint.isValid(mockContext(), time.clone().addMinute(1)));
}
use of jodd.datetime.JDateTime in project jodd by oblac.
the class TimeBeforeConstraintTest method testConstructor2.
@Test
public void testConstructor2() {
JDateTime time = new JDateTime();
TimeBeforeConstraint timeBeforeConstraint = new TimeBeforeConstraint(time);
assertEquals("time must be the same as was given to constructor", timeBeforeConstraint.getTime(), time);
}
Aggregations