#2547 - Update BaseTestCase to include CockroachDB

This commit is contained in:
Rob Bygrave
2022-02-04 08:41:34 +13:00
parent a72cbaf243
commit cf3499f0e4
@@ -200,7 +200,7 @@ public abstract class BaseTestCase {
}
public boolean isPostgresCompatible() {
return isPostgres() || isYugabyte();
return isPostgres() || isYugabyte() || isCockroach();
}
public boolean isPostgres() {
@@ -211,6 +211,10 @@ public abstract class BaseTestCase {
return Platform.YUGABYTE == platform().base();
}
public boolean isCockroach() {
return Platform.COCKROACH == platform().base();
}
public boolean isMySql() {
return Platform.MYSQL == platform();
}
@@ -281,7 +285,7 @@ public abstract class BaseTestCase {
* Platform specific IN clause assert.
*/
protected void platformAssertIn(String sql, String containsIn) {
if (isPostgres() || isYugabyte()) {
if (isPostgresCompatible()) {
assertThat(sql).contains(containsIn+" = any(");
} else {
assertThat(sql).contains(containsIn+" in ");