Fix Sybase failing test
This commit is contained in:
parent
718d1e4380
commit
a8201bacdb
|
@ -8,12 +8,12 @@ package org.hibernate.orm.test.query;
|
|||
|
||||
import java.sql.SQLException;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.cfg.AvailableSettings;
|
||||
import org.hibernate.dialect.SybaseDialect;
|
||||
import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
|
||||
import org.hibernate.jpa.QueryHints;
|
||||
import org.hibernate.query.NativeQuery;
|
||||
|
@ -38,7 +38,10 @@ import static org.mockito.Mockito.verify;
|
|||
@RequiresDialectFeature(DialectChecks.SupportsJdbcDriverProxying.class)
|
||||
public class QueryTimeOutTest extends BaseNonConfigCoreFunctionalTestCase {
|
||||
|
||||
private static final PreparedStatementSpyConnectionProvider CONNECTION_PROVIDER = new PreparedStatementSpyConnectionProvider( true, false );
|
||||
private static final PreparedStatementSpyConnectionProvider CONNECTION_PROVIDER = new PreparedStatementSpyConnectionProvider(
|
||||
true,
|
||||
false
|
||||
);
|
||||
private static final String QUERY = "update AnEntity set name = 'abc'";
|
||||
|
||||
@Override
|
||||
|
@ -67,7 +70,19 @@ public class QueryTimeOutTest extends BaseNonConfigCoreFunctionalTestCase {
|
|||
query.executeUpdate();
|
||||
|
||||
try {
|
||||
verify( CONNECTION_PROVIDER.getPreparedStatement( QUERY ), times( 1 ) ).setQueryTimeout( 123 );
|
||||
if ( getDialect() instanceof SybaseDialect ) {
|
||||
verify(
|
||||
CONNECTION_PROVIDER.getPreparedStatement(
|
||||
"update AnEntity set AnEntity.name = 'abc'" ),
|
||||
times( 1 )
|
||||
).setQueryTimeout( 123 );
|
||||
}
|
||||
else {
|
||||
verify(
|
||||
CONNECTION_PROVIDER.getPreparedStatement( QUERY ),
|
||||
times( 1 )
|
||||
).setQueryTimeout( 123 );
|
||||
}
|
||||
}
|
||||
catch (SQLException ex) {
|
||||
fail( "should not have thrown exception" );
|
||||
|
@ -86,7 +101,19 @@ public class QueryTimeOutTest extends BaseNonConfigCoreFunctionalTestCase {
|
|||
query.executeUpdate();
|
||||
|
||||
try {
|
||||
verify( CONNECTION_PROVIDER.getPreparedStatement( QUERY ), times( 1 ) ).setQueryTimeout( 123 );
|
||||
if ( getDialect() instanceof SybaseDialect ) {
|
||||
verify(
|
||||
CONNECTION_PROVIDER.getPreparedStatement(
|
||||
"update AnEntity set AnEntity.name = 'abc'" ),
|
||||
times( 1 )
|
||||
).setQueryTimeout( 123 );
|
||||
}
|
||||
else {
|
||||
verify(
|
||||
CONNECTION_PROVIDER.getPreparedStatement( QUERY ),
|
||||
times( 1 )
|
||||
).setQueryTimeout( 123 );
|
||||
}
|
||||
}
|
||||
catch (SQLException ex) {
|
||||
fail( "should not have thrown exception" );
|
||||
|
|
Loading…
Reference in New Issue