Merge pull request #2528 from FOCONIS/db2/disabled-tests

DB2 Fix tests for DB2
This commit is contained in:
Rob Bygrave authored and GitHub committed 2022-01-29 15:19:01 +13:00
commit cc1c08cd34
8 files changed
+25 -18

No files matched your search

@@ -41,7 +41,7 @@ public class DefaultServer_getReferenceTest extends BaseTestCase {
Vehicle reference = DB.reference(Vehicle.class, car.getId());
assertThat(reference).isInstanceOf(Car.class);
assertThat(reference.getId()).isSameAs(car.getId());
assertThat(reference.getId()).isEqualTo(car.getId());
DB.delete(car);
}
@@ -231,7 +231,7 @@ public class EqlParserTest extends BaseTestCase {
}
@Test
@IgnorePlatform(Platform.HANA) // The HANA JDBC driver checks the field length on binding and rejects 'NEW'
@IgnorePlatform({Platform.HANA, Platform.DB2}) // The HANA JDBC driver checks the field length on binding and rejects 'NEW'
public void where_or1() {
Query<Customer> query = parse("where name = 'Rob' or (status = 'NEW' and smallnote is null)");
@@ -241,17 +241,17 @@ public class EqlParserTest extends BaseTestCase {
}
@Test
@ForPlatform(Platform.HANA)
@ForPlatform({Platform.HANA, Platform.DB2})
public void where_or1_hana() {
Query<Customer> query = parse("where name = 'Rob' or (status = 'N' and smallnote is null)");
query.findList();
assertSql(query).contains("where (t0.name = ? or (t0.status = ? and t0.smallnote is null ) )");
assertSql(query).contains("where (t0.name = ? or (t0.status = ? and t0.smallnote is null))");
}
@Test
@IgnorePlatform(Platform.HANA) // The HANA JDBC driver checks the field length on binding and rejects 'NEW'
@IgnorePlatform({Platform.HANA, Platform.DB2}) // The HANA & DB2 JDBC driver checks the field length on binding and rejects 'NEW'
public void where_or2() {
Query<Customer> query = parse("where (name = 'Rob' or status = 'NEW') and smallnote is null");
@@ -261,17 +261,17 @@ public class EqlParserTest extends BaseTestCase {
}
@Test
@ForPlatform(Platform.HANA)
@ForPlatform({Platform.HANA, Platform.DB2})
public void where_or2_hana() {
Query<Customer> query = parse("where (name = 'Rob' or status = 'N') and smallnote is null");
query.findList();
assertSql(query).contains("where ((t0.name = ? or t0.status = ? ) and t0.smallnote is null )");
assertSql(query).contains("where ((t0.name = ? or t0.status = ?) and t0.smallnote is null)");
}
@Test
@IgnorePlatform(Platform.HANA) // The HANA JDBC driver checks the field length on binding and rejects 'NEW'
@IgnorePlatform({Platform.HANA, Platform.DB2}) // The HANA & DB2 JDBC driver checks the field length on binding and rejects 'NEW'
public void test_simplifyExpressions() {
Query<Customer> query = parse("where not (name = 'Rob' and status = 'NEW')");
@@ -288,20 +288,20 @@ public class EqlParserTest extends BaseTestCase {
}
@Test
@ForPlatform(Platform.HANA)
@ForPlatform({Platform.HANA, Platform.DB2})
public void test_simplifyExpressions_hana() {
Query<Customer> query = parse("where not (name = 'Rob' and status = 'N')");
query.findList();
assertSql(query).contains("where not (t0.name = ? and t0.status = ? )");
assertSql(query).contains("where not (t0.name = ? and t0.status = ?)");
query = parse("where not ((name = 'Rob' and status = 'N'))");
query.findList();
assertSql(query).contains("where not (t0.name = ? and t0.status = ? )");
assertSql(query).contains("where not (t0.name = ? and t0.status = ?)");
query = parse("where not (((name = 'Rob') and (status = 'N')))");
query.findList();
assertSql(query).contains("where not (t0.name = ? and t0.status = ? )");
assertSql(query).contains("where not (t0.name = ? and t0.status = ?)");
}
@Test
@@ -49,7 +49,7 @@ public class TestMetaAnnotation extends BaseTestCase {
* This test writes 101 spaces to "line1" which is annotated with &#64;Size(max=100).
*/
@Test
@IgnorePlatform({Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB}) // pg & mssql does not fail if string is too long.
@IgnorePlatform({Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB, Platform.DB2}) // pg & mssql does not fail if string is too long.
public void testWrite101SpacesToLine1() {
Address address = new Address();
@@ -66,7 +66,7 @@ public class TestMetaAnnotation extends BaseTestCase {
* This test writes 101 spaces to "line1" which is meta-annotated with {@link SizeMedium}.
*/
@Test
@IgnorePlatform({Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB})
@IgnorePlatform({Platform.POSTGRES, Platform.SQLSERVER, Platform.MYSQL, Platform.MARIADB, Platform.DB2})
public void testWrite101SpacesToLine2() {
Address address = new Address();
@@ -56,7 +56,7 @@ public class TestEncrypt extends BaseTestCase {
assertThat(loggedSql.get(1)).contains("left join e_basicenc t1 on t1.id = t0.other_id");
}
@IgnorePlatform(Platform.ORACLE)
@IgnorePlatform({Platform.ORACLE, Platform.DB2})
@Test
public void asDto() {
DB.find(EBasicEncrypt.class).delete();
@@ -70,7 +70,7 @@ public class TestHistoryExclude extends BaseTestCase {
linkFound.getDocs().size();
}
@IgnorePlatform(Platform.ORACLE)
@IgnorePlatform({Platform.ORACLE, Platform.DB2})
@Test
public void testAsOfThenLazy() {
@@ -37,7 +37,7 @@ public class TestHistoryInclude extends BaseTestCase {
assertThat(linkFound.getDocs().size()).isEqualTo(2);
}
@IgnorePlatform(Platform.ORACLE)
@IgnorePlatform({Platform.ORACLE, Platform.DB2})
@Test
public void testAsOfThenLazy() {
@@ -14,7 +14,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class TestHistoryOneToMany extends BaseTestCase {
@IgnorePlatform(Platform.ORACLE)
@IgnorePlatform({Platform.ORACLE, Platform.DB2})
@Test
public void test() throws InterruptedException {
@@ -3,6 +3,8 @@ package org.tests.model.m2m;
import io.ebean.BaseTestCase;
import io.ebean.DB;
import io.ebean.test.LoggedSql;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import java.util.List;
@@ -123,6 +125,11 @@ public class TestM2MWithWhere extends BaseTestCase {
// System.out.println(sb); dump the table
}
@AfterEach
void deleteTestData() {
DB.find(MnyEdge.class).delete();
DB.find(MnyNode.class).delete();
}
@Test
public void testWithDbTableName() {