Profiles to test oracle and hsql special DatabaseTypes

pull/2/head
Travis Burtrum 2018-05-19 00:32:25 -04:00
parent 5057a282bd
commit c899d07a71
6 changed files with 85 additions and 4 deletions

View File

@ -5,5 +5,27 @@
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
<id>maven.oracle.com</id>
<username>${env.ORACLE_LOGIN_userid}</username>
<password>${env.ORACLE_LOGIN_pass}</password>
<configuration>
<basicAuthScope>
<host>ANY</host>
<port>ANY</port>
<realm>OAM 11g</realm>
</basicAuthScope>
<httpConfiguration>
<all>
<params>
<property>
<name>http.protocol.allow-circular-redirects</name>
<value>%b,true</value>
</property>
</params>
</all>
</httpConfiguration>
</configuration>
</server>
</servers>
</settings>

View File

@ -27,7 +27,10 @@ before_script:
script:
- docker ps -a
- mvn test -B '-DjdbcUrl1=jdbc:postgresql:test_db' '-DjdbcUrl2=jdbc:mariadb://127.0.0.1:3306/test_db?user=root' '-DjdbcUrl3=jdbc:sqlserver://localhost:1433;databaseName=master;username=sa;password=<YourStrong!Passw0rd>;'
- mvn -B -pl '!test' clean install || travis_terminate 1;
- mvn -B -pl test clean test '-DjdbcUrl1=jdbc:postgresql:test_db' '-DjdbcUrl2=jdbc:mariadb://127.0.0.1:3306/test_db?user=root' '-DjdbcUrl3=jdbc:sqlserver://localhost:1433;databaseName=master;username=sa;password=<YourStrong!Passw0rd>;' || travis_terminate 1;
- mvn -B -pl test clean test -P oracle '-DjdbcUrl=derby' || travis_terminate 1; # todo: change jdbcUrl to actual oracle datasource
- mvn -B -pl test clean test -P unnest '-DjdbcUrl=hsqldb' || travis_terminate 1;
matrix:
include:

View File

@ -126,7 +126,7 @@ public class JdbcMapperProcessor extends AbstractProcessor {
enumType = types.getDeclaredType(elements.getTypeElement(Enum.class.getCanonicalName()), types.getWildcardType(null, null));
final String databaseType = processingEnv.getOptions().get("jdbcMapper.databaseType");
defaultDatabaseType = databaseType == null ? JdbcMapper.DatabaseType.STANDARD : JdbcMapper.DatabaseType.valueOf(databaseType);
defaultDatabaseType = databaseType == null || databaseType.isEmpty() ? JdbcMapper.DatabaseType.STANDARD : JdbcMapper.DatabaseType.valueOf(databaseType);
defaultArrayNumberTypeName = processingEnv.getOptions().get("jdbcMapper.arrayNumberTypeName");
if (defaultArrayNumberTypeName == null || defaultArrayNumberTypeName.isEmpty())
defaultArrayNumberTypeName = defaultDatabaseType.arrayNumberTypeName;

View File

@ -133,5 +133,61 @@
</dependency>
</dependencies>
</profile>
<profile>
<id>oracle</id>
<properties>
<oracle.driver.artifact>ojdbc6</oracle.driver.artifact>
<oracle.driver.version>11.2.0.4</oracle.driver.version>
</properties>
<dependencies>
<dependency>
<groupId>com.oracle.jdbc</groupId>
<artifactId>${oracle.driver.artifact}</artifactId>
<version>${oracle.driver.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven.oracle.com</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://maven.oracle.com</url>
<layout>default</layout>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<compilerArg>-AjdbcMapper.databaseType=ORACLE</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>unnest</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<compilerArg>-AjdbcMapper.databaseType=UNNEST</compilerArg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -20,7 +20,7 @@ import java.time.*;
*/
@JdbcMapper.Mapper(
jndiName = "bob",
// databaseType = JdbcMapper.DatabaseType.ORACLE
databaseType = JdbcMapper.DatabaseType.STANDARD, // todo: PrestoPersonDao breaks with ORACLE or UNNEST
cachePreparedStatements = JdbcMapper.OptionalBool.FALSE
// , sqlParser = SimpleSQLParser.class
, allowReflection = JdbcMapper.OptionalBool.TRUE

View File

@ -20,7 +20,7 @@ import java.time.*;
*/
@JdbcMapper.Mapper(
jndiName = "bob",
// databaseType = JdbcMapper.DatabaseType.ORACLE
databaseType = JdbcMapper.DatabaseType.STANDARD, // PrestoPersonDao breaks with ORACLE or UNNEST
cachePreparedStatements = JdbcMapper.OptionalBool.FALSE
, sqlParser = PrestoSQLParser.class
, allowReflection = JdbcMapper.OptionalBool.TRUE