From 5373496c7036af76588afff5559652fbdde56ba0 Mon Sep 17 00:00:00 2001 From: Vinicius Avellar Moreira Date: Tue, 13 Jun 2017 08:37:28 -0300 Subject: [PATCH 1/2] Fix RunCommand tests --- .../java/io/github/utplsql/cli/RunCommandTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/io/github/utplsql/cli/RunCommandTest.java b/src/test/java/io/github/utplsql/cli/RunCommandTest.java index 9184234..9ae9a48 100644 --- a/src/test/java/io/github/utplsql/cli/RunCommandTest.java +++ b/src/test/java/io/github/utplsql/cli/RunCommandTest.java @@ -12,7 +12,7 @@ */ public class RunCommandTest { - private RunCommand createCommand(String... args) { + private RunCommand createRunCommand(String... args) { RunCommand runCmd = new RunCommand(); JCommander.newBuilder() @@ -25,7 +25,7 @@ private RunCommand createCommand(String... args) { @Test public void reporterOptions_Default() { - RunCommand runCmd = createCommand("run", "app/app"); + RunCommand runCmd = createRunCommand("app/app@xe"); List reporterOptionsList = runCmd.getReporterOptionsList(); @@ -38,7 +38,7 @@ public void reporterOptions_Default() { @Test public void reporterOptions_OneReporter() { - RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-o=output.txt"); + RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-o=output.txt"); List reporterOptionsList = runCmd.getReporterOptionsList(); @@ -51,7 +51,7 @@ public void reporterOptions_OneReporter() { @Test public void reporterOptions_OneReporterForceScreen() { - RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-o=output.txt", "-s"); + RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-o=output.txt", "-s"); List reporterOptionsList = runCmd.getReporterOptionsList(); @@ -64,7 +64,7 @@ public void reporterOptions_OneReporterForceScreen() { @Test public void reporterOptions_OneReporterForceScreenInverse() { - RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-s", "-o=output.txt"); + RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-s", "-o=output.txt"); List reporterOptionsList = runCmd.getReporterOptionsList(); @@ -77,7 +77,7 @@ public void reporterOptions_OneReporterForceScreenInverse() { @Test public void reporterOptions_TwoReporters() { - RunCommand runCmd = createCommand("run", "app/app", + RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-f=ut_coverage_html_reporter", "-o=coverage.html", "-s"); From c1a985d64aa6332ac8a9c7205545cea40d8d7557 Mon Sep 17 00:00:00 2001 From: Vinicius Avellar Moreira Date: Tue, 13 Jun 2017 09:40:21 -0300 Subject: [PATCH 2/2] Maven cache changes --- .travis.yml | 3 ++- .travis/maven_cfg.sh | 29 ++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2cf6143..5833ca6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,14 @@ jdk: env: global: + - CACHE_DIR=$HOME/.cache - MAVEN_HOME=/usr/local/maven - MAVEN_CFG=$HOME/.m2 cache: directories: + - $CACHE_DIR - $MAVEN_CFG - - $MAVEN_HOME/lib/ext # Used to cache wagon-http lib. install: - bash .travis/maven_cfg.sh diff --git a/.travis/maven_cfg.sh b/.travis/maven_cfg.sh index 3505d49..6017b04 100644 --- a/.travis/maven_cfg.sh +++ b/.travis/maven_cfg.sh @@ -2,25 +2,28 @@ set -ev cd $(dirname $(readlink -f $0)) -if [ -f $MAVEN_CFG/repository ]; then - echo "Using cached maven dependencies..." - exit 0 -fi - -if [ "$ORACLE_OTN_USER" == "" ] || [ "$ORACLE_OTN_PASSWORD" == "" ]; then - echo "Oracle OTN username/password not specified." - exit 1 -fi - # Download wagon-http recommended by Oracle. # On maven latest version this is not needed, but travis doesn't have it. -curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar" -sudo mv wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/ +if [ ! -f $CACHE_DIR/wagon-http-2.8-shaded.jar ]; then + curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar" + mv wagon-http-2.8-shaded.jar $CACHE_DIR/ + sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/ +else + echo "Using cached wagon-http..." + sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/ +fi # Create the settings file with oracle server config. -cp settings.xml $MAVEN_CFG/settings.xml +# If file already exists, Oracle dependencies were cached on previous build. +if [ ! -f $MAVEN_CFG/.cached ]; then + cp settings.xml $MAVEN_CFG/settings.xml + touch $MAVEN_CFG/.cached +else + echo "Using cached maven settings..." +fi # The Java API is not available on a public repository yet, we need to download and install it locally. +# Always downloading the latest development version. git clone https://github.com/utPLSQL/utPLSQL-java-api.git cd utPLSQL-java-api mvn package install -DskipTests