HHH-10465 - Loss of precision in temporal JavaTypeDescriptor implementations

Fix test to work on UTC-X timezones as well
This commit is contained in:
Vlad Mihalcea 2016-10-25 14:54:01 +03:00
parent 3e5025ac10
commit 7b263f8697
1 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,7 @@ package org.hibernate.test.type;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.concurrent.TimeUnit;
import javax.persistence.Entity;
import javax.persistence.Id;
@ -43,8 +44,8 @@ public class TimeAndTimestampTest extends BaseNonConfigCoreFunctionalTestCase {
} );
doInHibernate( this::sessionFactory, session -> {
Event event = session.find( Event.class, 1L );
assertEquals(123, event.timeValue.getTime());
assertEquals(456, event.timestampValue.getTime());
assertEquals(123, event.timeValue.getTime() % TimeUnit.DAYS.toMillis( 1 ));
assertEquals(456, event.timestampValue.getTime() % TimeUnit.DAYS.toMillis( 1 ));
} );
}