From f2178bf0a6508de6e7bf0e29fad9c632785a1625 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Mon, 4 May 2020 12:41:14 +1200 Subject: [PATCH] #2003 - Bump ebean-datasource to 4.9.2 with optional driver --- pom.xml | 2 +- .../org/tests/delete/TestDeleteByQuery.java | 10 ++- src/test/resources/ebean.properties | 64 ++++++++----------- 3 files changed, 34 insertions(+), 42 deletions(-) diff --git a/pom.xml b/pom.xml index a9a6a8e8f..a70e6e354 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ io.ebean ebean-datasource - 4.9.1 + 4.9.2 diff --git a/src/test/java/org/tests/delete/TestDeleteByQuery.java b/src/test/java/org/tests/delete/TestDeleteByQuery.java index d48154d31..52fc8eb73 100644 --- a/src/test/java/org/tests/delete/TestDeleteByQuery.java +++ b/src/test/java/org/tests/delete/TestDeleteByQuery.java @@ -43,9 +43,13 @@ public class TestDeleteByQuery extends BaseTestCase { assertThat(rows).isEqualTo(3); List sql = LoggedSqlCollector.stop(); - assertSql(sql.get(0)).contains("delete from bbookmark_user where id in (select t0.id from bbookmark_user t0 where t0.name like"); - if (isH2() || isPostgres()) { - assertSql(sql.get(0)).contains("limit 3"); + if (isSqlServer()) { + assertSql(sql.get(0)).contains("delete from bbookmark_user where id in (select top 3 t0.id from bbookmark_user t0 where t0.name like "); + } else { + assertSql(sql.get(0)).contains("delete from bbookmark_user where id in (select t0.id from bbookmark_user t0 where t0.name like"); + if (isH2() || isPostgres()) { + assertSql(sql.get(0)).contains("limit 3"); + } } final int rowsAfter = DB.find(BBookmarkUser.class) diff --git a/src/test/resources/ebean.properties b/src/test/resources/ebean.properties index 964dc2972..06b1cd2f0 100644 --- a/src/test/resources/ebean.properties +++ b/src/test/resources/ebean.properties @@ -22,7 +22,7 @@ ebean.ddl.generate=true ebean.ddl.run=true ebean.ddl.header=-- Generated by ebean ${version} at ${timestamp} ebean.packages=org.tests -datasource.default=h2 +datasource.default=sqlserver #datasource.h2.capturestacktrace=true ebean.dumpMetricsOnShutdown=true @@ -72,8 +72,8 @@ datasource.db.databaseDriver=org.h2.Driver datasource.h2.username=sa datasource.h2.password= -datasource.h2.databaseUrl=jdbc:h2:mem:tests -datasource.h2.databaseDriver=org.h2.Driver +datasource.h2.url=jdbc:h2:mem:tests +#datasource.h2.driver=org.h2.Driver datasource.h2.minConnections=1 datasource.h2.maxConnections=25 #datasource.h2.heartbeatsql=select 1 @@ -87,61 +87,53 @@ datasource.h2.poolListener=org.tests.basic.MyTestDataSourcePoolListener datasource.h2multitenant.username=sa datasource.h2multitenant.password= datasource.h2multitenant.url=jdbc:h2:mem:h2multitenant -datasource.h2multitenant.driver=org.h2.Driver datasource.h2autocommit.autoCommit=true datasource.h2autocommit.username=sa datasource.h2autocommit.password= datasource.h2autocommit.databaseUrl=jdbc:h2:mem:autocommittests -datasource.h2autocommit.databaseDriver=org.h2.Driver datasource.h2autocommit2.autoCommit=true datasource.h2autocommit2.username=sa datasource.h2autocommit2.password= -datasource.h2autocommit2.databaseUrl=jdbc:h2:mem:autocommit2tests -datasource.h2autocommit2.databaseDriver=org.h2.Driver +datasource.h2autocommit2.url=jdbc:h2:mem:autocommit2tests datasource.h2other.username=sa datasource.h2other.password= -datasource.h2other.databaseUrl=jdbc:h2:mem:h2other -datasource.h2other.databaseDriver=org.h2.Driver +datasource.h2other.url=jdbc:h2:mem:h2other datasource.h2otherfind.username=sa datasource.h2otherfind.password= -datasource.h2otherfind.databaseUrl=jdbc:h2:mem:h2otherfind -datasource.h2otherfind.databaseDriver=org.h2.Driver +datasource.h2otherfind.url=jdbc:h2:mem:h2otherfind datasource.h2ebasicver.username=sa datasource.h2ebasicver.password= -datasource.h2ebasicver.databaseUrl=jdbc:h2:mem:h2ebasicver -datasource.h2ebasicver.databaseDriver=org.h2.Driver +datasource.h2ebasicver.url=jdbc:h2:mem:h2ebasicver datasource.h2ebasicver2.username=sa datasource.h2ebasicver2.password= -datasource.h2ebasicver2.databaseUrl=jdbc:h2:mem:h2ebasicver -datasource.h2ebasicver2.databaseDriver=org.h2.Driver +datasource.h2ebasicver2.url=jdbc:h2:mem:h2ebasicver datasource.sqlite.username= datasource.sqlite.password= -datasource.sqlite.databaseUrl=jdbc:sqlite:mydb.db -datasource.sqlite.databaseDriver=org.sqlite.JDBC +datasource.sqlite.url=jdbc:sqlite:mydb.db +datasource.sqlite.driver=org.sqlite.JDBC datasource.sqlite.isolationlevel=read_uncommitted datasource.hsqldb.username=sa datasource.hsqldb.password= -datasource.hsqldb.databaseUrl=jdbc:hsqldb:mem:tests -datasource.hsqldb.databaseDriver=org.hsqldb.jdbcDriver +datasource.hsqldb.url=jdbc:hsqldb:mem:tests # Set caseSensitiveCollation to false when using # MySql with case insensitive collation #ebean.mysql.caseSensitiveCollation=false datasource.mysql.username=unit datasource.mysql.password=unit -datasource.mysql.databaseUrl=jdbc:mysql://127.0.0.1:4306/unit +datasource.mysql.url=jdbc:mysql://127.0.0.1:4306/unit #datasource.mysql.username=test_ebean #datasource.mysql.password=test -#datasource.mysql.databaseUrl=jdbc:mysql://127.0.0.1:4306/test_ebean -datasource.mysql.databaseDriver=com.mysql.cj.jdbc.Driver +#datasource.mysql.url=jdbc:mysql://127.0.0.1:4306/test_ebean +#datasource.mysql.driver=com.mysql.cj.jdbc.Driver datasource.cockroach.username=root datasource.cockroach.password= @@ -150,23 +142,21 @@ datasource.cockroach.driver=org.postgresql.Driver datasource.oracle.username=test_ebean datasource.oracle.password=test -datasource.oracle.databaseUrl=jdbc:oracle:thin:@localhost:1521:XE -datasource.oracle.databaseDriver=oracle.jdbc.driver.OracleDriver +datasource.oracle.url=jdbc:oracle:thin:@localhost:1521:XE +#datasource.oracle.driver=oracle.jdbc.driver.OracleDriver ## set this to use timestamp rather than timestamptz #ebean.postgres.timestamp=timestamp datasource.pg.username=unit datasource.pg.password=unit -datasource.pg.databaseUrl=jdbc:postgresql://127.0.0.1:5432/unit -datasource.pg.databaseDriver=org.postgresql.Driver +datasource.pg.url=jdbc:postgresql://127.0.0.1:5432/unit #datasource.pg.capturestacktrace=true datasource.pg.maxStackTraceSize=50 datasource.pg9.username=unit datasource.pg9.password=unit -datasource.pg9.databaseUrl=jdbc:postgresql://127.0.0.1:9432/unit -datasource.pg9.databaseDriver=org.postgresql.Driver +datasource.pg9.url=jdbc:postgresql://127.0.0.1:9432/unit #ebean.sqlserver.idType=SEQUENCE @@ -179,29 +169,28 @@ ebean.sqlserver.databasePlatformName=sqlserver17 datasource.sqlserver.username=test_ebean datasource.sqlserver.password=SqlS3rv#r datasource.sqlserver.url=jdbc:sqlserver://localhost:1433;databaseName=test_ebean;sendTimeAsDateTime=false -datasource.sqlserver.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver +#datasource.sqlserver.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver datasource.nuodb.schema=test_user datasource.nuodb.username=test_user datasource.nuodb.password=test datasource.nuodb.url=jdbc:com.nuodb://localhost/testdb -datasource.nuodb.driver=com.nuodb.jdbc.Driver +#datasource.nuodb.driver=com.nuodb.jdbc.Driver datasource.db2.username=db2admin datasource.db2.password=veryverysecret#1234 -datasource.db2.databaseUrl=jdbc:db2://127.0.0.1:50000/SAMPLE -datasource.db2.databaseDriver=com.ibm.db2.jcc.DB2Driver +datasource.db2.url=jdbc:db2://127.0.0.1:50000/SAMPLE +#datasource.db2.driver=com.ibm.db2.jcc.DB2Driver datasource.hana.username=EBEAN_TEST datasource.hana.password=Eb3an_test -datasource.hana.databaseUrl=jdbc:sap://hxehost:39013/?databaseName=HXE -datasource.hana.databaseDriver=com.sap.db.jdbc.Driver +datasource.hana.url=jdbc:sap://hxehost:39013/?databaseName=HXE +#datasource.hana.driver=com.sap.db.jdbc.Driver # parameters for migration test datasource.migrationtest.username=SA datasource.migrationtest.password=SA -datasource.migrationtest.databaseUrl=jdbc:h2:mem:migration -datasource.migrationtest.databaseDriver=org.h2.Driver +datasource.migrationtest.url=jdbc:h2:mem:migration ebean.migrationtest.applyPrefix=V ebean.migrationtest.ddl.generate=false ebean.migrationtest.ddl.run=false @@ -213,8 +202,7 @@ ebean.migrationtest.migration.strict=true # parameters for migration test datasource.migrationtest-history.username=SA datasource.migrationtest-history.password=SA -datasource.migrationtest-history.databaseUrl=jdbc:h2:mem:migration -datasource.migrationtest-history.databaseDriver=org.h2.Driver +datasource.migrationtest-history.url=jdbc:h2:mem:migration ebean.migrationtest-history.applyPrefix=V ebean.migrationtest-history.ddl.generate=false ebean.migrationtest-history.ddl.run=false