Yugabyte - Fix some tests for running against Yugabyte

This commit is contained in:
Rob Bygrave committed 2022-02-01 09:49:23 +13:00
1 parent 1359d534d5
commit b4ddbe38ee
4 files changed
+9 -5

No files matched your search

@@ -199,6 +199,10 @@ public abstract class BaseTestCase {
return Platform.POSTGRES == platform().base();
}
public boolean isYugabyte() {
return Platform.YUGABYTE == platform().base();
}
public boolean isMySql() {
return Platform.MYSQL == platform();
}
@@ -27,7 +27,7 @@ public class TestInetAddressType extends TransactionalTestCase {
@Test
public void testIp6() throws UnknownHostException {
if (isPostgres()) {
if (isPostgres() || isYugabyte()) {
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");
@@ -369,7 +369,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
if (isH2()) {
assertSql(sql.get(0)).contains("from o_cached_natkey3 t0 where t0.store = ? and concat(t0.sku,'-',t0.code) in (?,?) order by t0.sku desc; --bind(def,Array[2]={2-1000,3-1000})");
} else if (isPostgres() || isOracle() || isDb2()) {
} else if (isPostgres() || isOracle() || isDb2() || isYugabyte()) {
assertSql(sql.get(0)).contains("from o_cached_natkey3 t0 where t0.store = ? and (t0.sku||'-'||t0.code)");
} else if (isHana()) {
assertSql(sql.get(0)).contains("from o_cached_natkey3 t0 where t0.store = ? and concat(t0.sku, '-'||t0.code)");
@@ -412,7 +412,7 @@ public class TestCacheViaComplexNaturalKey3 extends BaseTestCase {
if (isH2()) {
assertSql(sql.get(0)).contains("from o_cached_natkey3 t0 where t0.store = ? and concat(t0.sku,':',t0.code,'-foo') in (?,?) order by t0.sku desc; --bind(def,Array[2]={2:1000-foo,3:1000-foo})");
} else if (isPostgres() || isOracle() || isDb2()){
} else if (isPostgres() || isOracle() || isDb2() || isYugabyte()){
assertSql(sql.get(0)).contains("from o_cached_natkey3 t0 where t0.store = ? and (t0.sku||':'||t0.code||'-foo')");
} else if (isHana()){
assertSql(sql.get(0)).contains("from o_cached_natkey3 t0 where t0.store = ? and concat(t0.sku, ':'||t0.code||'-foo')");
@@ -52,8 +52,8 @@ class TestElementCollectionBasicSet extends BaseTestCase {
Set<String> phoneNumbers1 = found.get(1).getPhoneNumbers();
phoneNumbers0.size();
assertThat(phoneNumbers0).containsExactly("021 1234", "021 4321");
assertThat(phoneNumbers1).containsExactly("09 1234", "09 4321", "09 9876");
assertThat(phoneNumbers0).containsExactlyInAnyOrder("021 1234", "021 4321");
assertThat(phoneNumbers1).containsExactlyInAnyOrder("09 1234", "09 4321", "09 9876");
sql = LoggedSql.collect();
assertThat(sql).hasSize(2);