mirror of
https://github.com/moparisthebest/JdbcMapper
synced 2024-11-21 08:35:00 -05:00
Add mariadb and postgresql tests
This commit is contained in:
parent
1d6f71918c
commit
30599a15fd
12
.travis.yml
12
.travis.yml
@ -2,6 +2,18 @@ language: java
|
||||
sudo: false
|
||||
dist: trusty
|
||||
|
||||
services:
|
||||
- postgresql
|
||||
|
||||
addons:
|
||||
mariadb: '10.2'
|
||||
|
||||
before_script:
|
||||
- psql -c 'create database test_db;' -U postgres || travis_terminate 1;
|
||||
- mysql -u root -e 'CREATE DATABASE IF NOT EXISTS test_db;' || travis_terminate 1;
|
||||
|
||||
script: mvn test -B '-DjdbcUrl1=jdbc:postgresql:test_db' '-DjdbcUrl2=jdbc:mariadb://127.0.0.1:3306/test_db?user=root'
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- env: JDK='OpenJDK 6'
|
||||
|
@ -128,7 +128,7 @@ public interface JdbcMapper extends Closeable {
|
||||
|
||||
public enum DatabaseType {
|
||||
DEFAULT(null, null),
|
||||
STANDARD("number", "text"),
|
||||
STANDARD("numeric", "text"),
|
||||
ORACLE("ARRAY_NUM_TYPE", "ARRAY_STR_TYPE");
|
||||
|
||||
public final String arrayNumberTypeName, arrayStringTypeName;
|
||||
|
@ -24,7 +24,7 @@ public class ArrayInList implements InList {
|
||||
}
|
||||
|
||||
public ArrayInList() {
|
||||
this("number", "text");
|
||||
this("numeric", "text");
|
||||
}
|
||||
|
||||
protected String columnAppend(final String columnName) {
|
||||
|
@ -58,7 +58,10 @@ public class QueryMapperQmDao implements QmDao {
|
||||
static {
|
||||
Collection<Class<?>> no = new ArrayList<Class<?>>();
|
||||
for(final String connectionClassName : new String[]{
|
||||
"org.hsqldb.jdbc.JDBCConnection", "org.apache.derby.impl.jdbc.EmbedConnection", "org.sqlite.jdbc3.JDBC3Connection"
|
||||
"org.apache.derby.impl.jdbc.EmbedConnection"
|
||||
, "org.hsqldb.jdbc.JDBCConnection"
|
||||
, "org.sqlite.jdbc3.JDBC3Connection"
|
||||
, "org.mariadb.jdbc.MariaDbConnection"
|
||||
// h2 doesn't support this with java6 either...
|
||||
/*IFJAVA6_START
|
||||
, "org.h2.jdbc.JdbcConnection"
|
||||
|
@ -32,14 +32,15 @@ import static org.junit.Assert.assertNull;
|
||||
@RunWith(Parameterized.class)
|
||||
public class QueryMapperTest {
|
||||
|
||||
public static final Person fieldPerson1 = new FieldPerson(1, new Date(0), "First", "Person");
|
||||
public static final Boss fieldBoss1 = new FieldBoss(2, new Date(0), "Second", "Person", "Finance", "Second");
|
||||
public static final Boss fieldBoss2 = new FieldBoss(3, new Date(0), "Third", "Person", "Finance", null);
|
||||
public static final Boss fieldBoss3 = new FieldBoss(4, new Date(0), null, "Person", "Finance", "Fourth");
|
||||
public static final Person fieldPerson2 = new FieldPerson(5, new Date(0), "Second", "Person");
|
||||
public static final Person fieldPerson3 = new FieldPerson(6, new Date(0), "Third", "Person");
|
||||
private static final long birthDateMillis = 1000; // this used to be 0 but mysql TIMESTAMP can only represent '1970-01-01 00:00:01' not '1970-01-01 00:00:00', nice! o_O
|
||||
public static final Person fieldPerson1 = new FieldPerson(1, new Date(birthDateMillis), "First", "Person");
|
||||
public static final Boss fieldBoss1 = new FieldBoss(2, new Date(birthDateMillis), "Second", "Person", "Finance", "Second");
|
||||
public static final Boss fieldBoss2 = new FieldBoss(3, new Date(birthDateMillis), "Third", "Person", "Finance", null);
|
||||
public static final Boss fieldBoss3 = new FieldBoss(4, new Date(birthDateMillis), null, "Person", "Finance", "Fourth");
|
||||
public static final Person fieldPerson2 = new FieldPerson(5, new Date(birthDateMillis), "Second", "Person");
|
||||
public static final Person fieldPerson3 = new FieldPerson(6, new Date(birthDateMillis), "Third", "Person");
|
||||
|
||||
public static final Person fieldPerson1NullName = new FieldPerson(1, new Date(0), null, null);
|
||||
public static final Person fieldPerson1NullName = new FieldPerson(1, new Date(birthDateMillis), null, null);
|
||||
|
||||
public static final Person[] people = new Person[]{fieldPerson1, fieldPerson2, fieldPerson3};
|
||||
public static final Boss[] bosses = new Boss[]{fieldBoss1, fieldBoss2, fieldBoss3};
|
||||
|
Loading…
Reference in New Issue
Block a user