Fix broken tests on Jenkins

This commit is contained in:
Vlad Mihalcea 2016-09-13 14:57:32 +03:00
parent 62e499538c
commit a00a30f488
8 changed files with 39 additions and 26 deletions

View File

@ -69,7 +69,9 @@ public class JdbcTimestampCustomSessionLevelTimeZoneTest
public void testTimeZone() {
connectionProvider.clear();
doInHibernateSessionBuilder( () -> {return sessionFactory().withOptions().jdbcTimeZone( TIME_ZONE);}, s -> {
doInHibernateSessionBuilder( () -> {
return sessionFactory().withOptions().jdbcTimeZone( TIME_ZONE );
}, s -> {
Person person = new Person();
person.id = 1L;
s.persist( person );
@ -97,7 +99,9 @@ public class JdbcTimestampCustomSessionLevelTimeZoneTest
}
connectionProvider.clear();
doInHibernateSessionBuilder( () -> {return sessionFactory().withOptions().jdbcTimeZone( TIME_ZONE);}, s -> {
doInHibernateSessionBuilder( () -> {
return sessionFactory().withOptions().jdbcTimeZone( TIME_ZONE );
}, s -> {
s.doWork( connection -> {
try ( Statement st = connection.createStatement() ) {
try ( ResultSet rs = st.executeQuery(

View File

@ -10,16 +10,20 @@ import java.util.Map;
import java.util.TimeZone;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.test.util.jdbc.TimeZoneConnectionProvider;
/**
* @author Vlad Mihalcea
*/
@RequiresDialect(value = PostgreSQL82Dialect.class)
public class JdbcTimestampUTCTimeZoneTest
extends JdbcTimestampWithoutUTCTimeZoneTest {
private TimeZoneConnectionProvider connectionProvider = new TimeZoneConnectionProvider( "America/Los_Angeles" );
private TimeZoneConnectionProvider connectionProvider = new TimeZoneConnectionProvider(
"America/Los_Angeles" );
private static final TimeZone TIME_ZONE = TimeZone.getTimeZone( "UTC" );

View File

@ -9,16 +9,20 @@ package org.hibernate.test.timestamp;
import java.util.Map;
import org.hibernate.cfg.AvailableSettings;
import org.hibernate.dialect.PostgreSQL82Dialect;
import org.hibernate.testing.RequiresDialect;
import org.hibernate.test.util.jdbc.TimeZoneConnectionProvider;
/**
* @author Vlad Mihalcea
*/
@RequiresDialect(value = PostgreSQL82Dialect.class)
public class JdbcTimestampWithDefaultUTCTimeZoneTest
extends JdbcTimestampWithoutUTCTimeZoneTest {
private TimeZoneConnectionProvider connectionProvider = new TimeZoneConnectionProvider( "UTC" );
private TimeZoneConnectionProvider connectionProvider = new TimeZoneConnectionProvider(
"UTC" );
@Override
protected void addSettings(Map settings) {

View File

@ -33,7 +33,8 @@ import static org.junit.Assert.assertEquals;
public class JdbcTimestampWithoutUTCTimeZoneTest
extends BaseNonConfigCoreFunctionalTestCase {
private TimeZoneConnectionProvider connectionProvider = new TimeZoneConnectionProvider( "America/Los_Angeles" );
private TimeZoneConnectionProvider connectionProvider = new TimeZoneConnectionProvider(
"America/Los_Angeles" );
@Override
protected Class<?>[] getAnnotatedClasses() {