Skip to content

Fix travis build #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ env:
- DOCKER_CFG=$HOME/.docker
- DOCKER_REPO="viniciusam/oracledb"
- MAVEN_HOME=/usr/local/maven
- DB_USER=app
- DB_PASS=app
- MAVEN_CFG=$HOME/.m2
- API_DB_URL="127.0.0.1:1521:XE"
- API_DB_USER=api
- API_DB_PASS=api
matrix:
- ORACLE_VERSION="11g-xe-r2" CONNECTION_STR="127.0.0.1:1521/XE" DOCKER_OPTIONS="--shm-size=1g"

cache:
directories:
- $DOCKER_CFG
- $HOME/.m2
- $MAVEN_CFG
- $MAVEN_HOME/lib/ext # Used to cache wagon-http lib.

install:
Expand Down
2 changes: 1 addition & 1 deletion .travis/create_app_user.sh → .travis/create_api_user.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -ev

sqlplus -S -L sys/oracle@//$CONNECTION_STR AS SYSDBA <<EOF
sqlplus -S -L / AS SYSDBA <<EOF
create user $DB_USER identified by $DB_PASS
quota unlimited on USERS
default tablespace USERS;
Expand Down
3 changes: 2 additions & 1 deletion .travis/install_utplsql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ EOF
# docker cp ./$UTPLSQL_FILE.tar.gz $ORACLE_VERSION:/$UTPLSQL_FILE.tar.gz
docker cp ./$UTPLSQL_FILE $ORACLE_VERSION:/$UTPLSQL_FILE
docker cp ./install.sh.tmp $ORACLE_VERSION:/install.sh
docker cp ./create_api_user.sh $ORACLE_VERSION:/create_api_user.sh

# Remove temporary files.
# rm $UTPLSQL_FILE.tar.gz
rm install.sh.tmp

# Execute the utPLSQL installation inside the container.
docker exec $ORACLE_VERSION bash install.sh
docker exec $ORACLE_VERSION bash -c "install.sh && create_api_user.sh"
16 changes: 6 additions & 10 deletions .travis/maven_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
set -ev
cd $(dirname $(readlink -f $0))

mavenSettings=$HOME/.m2/settings.xml
mavenCached=$HOME/.m2/.cached

if [ -f $mavenCached ]; then
echo "Using cached maven user config..."
if [ -f $MAVEN_CFG/repository ]; then
echo "Using cached maven dependencies..."
exit 0
fi

Expand All @@ -21,8 +18,7 @@ curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.
sudo mv wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/

# Create the settings file with oracle server config.
cp settings.tmpl.xml $mavenSettings
sed -i -e "s|###USERNAME###|$ORACLE_OTN_USER|g" $mavenSettings
sed -i -e "s|###PASSWORD###|$ORACLE_OTN_PASSWORD|g" $mavenSettings

touch $mavenCached
cp settings.xml $MAVEN_CFG/settings.xml
#cp settings.tmpl.xml $MAVEN_CFG/settings.xml
#sed -i -e "s|###USERNAME###|$ORACLE_OTN_USER|g" $MAVEN_CFG/settings.xml
#sed -i -e "s|###PASSWORD###|$ORACLE_OTN_PASSWORD|g" $MAVEN_CFG/settings.xml
5 changes: 2 additions & 3 deletions src/main/java/io/github/utplsql/api/types/CustomTypes.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package io.github.utplsql.api.types;

/**
* Created by Vinicius on 13/04/2017.
* DBHelper custom data types.
* Database custom data types.
*/
public enum CustomTypes {
// Object names must be upper case.
UT_DOCUMENTATION_REPORTER("UT_DOCUMENTATION_REPORTER"),
UT_COVERAGE_HTML_REPORTER("UT_COVERAGE_HTML_REPORTER"),
UT_VARCHAF2_LIST("UT_VARCHAR2_LIST");
UT_VARCHAR2_LIST("UT_VARCHAR2_LIST");

private String typeName;

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/github/utplsql/api/OutputBufferTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class OutputBufferTest {

@Rule
public static final DatabaseRule db = new DatabaseRule();
public final DatabaseRule db = new DatabaseRule();

public BaseReporter createReporter() throws SQLException {
Connection conn = db.newConnection();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/io/github/utplsql/api/TestRunnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class TestRunnerTest {

@Rule
public static final DatabaseRule db = new DatabaseRule();
public final DatabaseRule db = new DatabaseRule();

@Test
public void runWithDocumentationReporter() {
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/io/github/utplsql/api/rules/DatabaseRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class DatabaseRule extends ExternalResource {
private static String sPass;

static {
sUrl = System.getenv("DB_URL") != null ? System.getenv("DB_URL") : "127.0.0.1:1521:XE";
sUser = System.getenv("DB_USER") != null ? System.getenv("DB_USER") : "app";
sPass = System.getenv("DB_PASS") != null ? System.getenv("DB_PASS") : "app";
sUrl = System.getenv("API_DB_URL") != null ? System.getenv("API_DB_URL") : "127.0.0.1:1521:XE";
sUser = System.getenv("API_DB_USER") != null ? System.getenv("API_DB_USER") : "app";
sPass = System.getenv("API_DB_PASS") != null ? System.getenv("API_DB_PASS") : "app";
}

private List<Connection> connectionList;
Expand Down