Modify tests to use isPostgresCompatible() (to effectively include Yugabyte)

This commit is contained in:
Rob Bygrave
2022-02-02 23:25:13 +13:00
parent 4899f23773
commit 389f2bcd2f
25 changed files with 37 additions and 49 deletions
@@ -34,8 +34,6 @@ public class TestQueryForUpdate extends BaseTestCase {
if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock)");
} else if (isPostgres()) {
assertThat(sqlOf(query)).contains("for update");
} else {
assertThat(sqlOf(query)).contains("for update");
}
@@ -134,14 +132,10 @@ public class TestQueryForUpdate extends BaseTestCase {
List<String> sql = LoggedSql.stop();
assertThat(sql).hasSize(2);
if (isH2() || isPostgres()) {
if (isH2() || isPostgresCompatible()) {
assertSql(sql.get(0)).contains("from e_basic t0 where t0.id =");
assertSql(sql.get(1)).contains("from e_basic t0 where t0.id =");
if (isPostgres()) {
assertSql(sql.get(1)).contains("for update");
} else {
assertSql(sql.get(1)).contains("for update");
}
assertSql(sql.get(1)).contains("for update");
}
transaction.end();
@@ -165,8 +159,6 @@ public class TestQueryForUpdate extends BaseTestCase {
assertThat(sqlOf(query)).contains("for update");
} else if (isSqlServer()) {
assertThat(sqlOf(query)).contains("with (updlock,nowait)");
} else if (isPostgres()) {
assertThat(sqlOf(query)).contains("for update nowait");
} else {
assertThat(sqlOf(query)).contains("for update nowait");
}
@@ -192,8 +184,6 @@ public class TestQueryForUpdate extends BaseTestCase {
assertThat(sqlOf(query)).contains("with (updlock,nowait)");
} else if (isH2()) {
assertThat(sqlOf(query)).contains("for update");
} else if (isPostgres()) {
assertThat(sqlOf(query)).contains("for update nowait");
} else {
assertThat(sqlOf(query)).contains("for update nowait");
}
@@ -26,8 +26,7 @@ public class TestInetAddressType extends TransactionalTestCase {
@Test
public void testIp6() throws UnknownHostException {
if (isPostgres() || isYugabyte()) {
if (isPostgresCompatible()) {
insertUpdateDeleteFind("2001:db8:85a3:0:0:8a2e:370:7334", "2001:db8:85a3::8a2e:370:7334", "2001:4f8:3:ba::/64", "2001:4f8:3:ba::/64");
} else {
insertUpdateDeleteFind("2001:db8:85a3:0:0:8a2e:370:7334", "2001:db8:85a3:0:0:8a2e:370:7334", "192.168.100.128/25", "192.168.100.128/25");
@@ -43,7 +43,7 @@ public class TestSqlRowUUID extends BaseTestCase {
assertThat(value).isEqualTo(e.getId());
if (isPostgres()) {
if (isPostgresCompatible()) {
usingPostrgesAnyWithPositionedParameter_needsExplicitCast(e);
}
}