HHH-13724 Fix failing tests
This commit is contained in:
parent
7dba4c2a61
commit
e60299c440
|
@ -36,7 +36,7 @@ public class HHH14112Test extends BaseCoreFunctionalTestCase {
|
||||||
|
|
||||||
@Entity(name = "Super")
|
@Entity(name = "Super")
|
||||||
@Inheritance(strategy = InheritanceType.JOINED)
|
@Inheritance(strategy = InheritanceType.JOINED)
|
||||||
@Where(clause = "DELETED = 0")
|
@Where(clause = "DELETED = false")
|
||||||
public static class Super {
|
public static class Super {
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
|
|
|
@ -18,6 +18,7 @@ import javax.persistence.OptimisticLockException;
|
||||||
import javax.persistence.Version;
|
import javax.persistence.Version;
|
||||||
|
|
||||||
import org.hibernate.cfg.AvailableSettings;
|
import org.hibernate.cfg.AvailableSettings;
|
||||||
|
import org.hibernate.dialect.CockroachDB192Dialect;
|
||||||
|
|
||||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -91,8 +92,21 @@ public class BatchOptimisticLockingTest extends
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
catch (Exception expected) {
|
catch (Exception expected) {
|
||||||
assertEquals( OptimisticLockException.class, expected.getClass());
|
assertEquals( OptimisticLockException.class, expected.getClass() );
|
||||||
assertEquals( "Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1; statement executed: update Person set name=?, version=? where id=? and version=?", expected.getMessage() );
|
if ( getDialect() instanceof CockroachDB192Dialect ) {
|
||||||
|
// CockroachDB always runs in SERIALIZABLE isolation, and uses SQL state 40001 to indicate
|
||||||
|
// serialization failure.
|
||||||
|
assertEquals(
|
||||||
|
"org.hibernate.exception.LockAcquisitionException: could not execute batch",
|
||||||
|
expected.getMessage()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assertEquals(
|
||||||
|
"Batch update returned unexpected row count from update [1]; actual row count: 0; expected: 1; statement executed: update Person set name=?, version=? where id=? and version=?",
|
||||||
|
expected.getMessage()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue