Skip to content
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 16 additions & 13 deletions .travis/maven_cfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions src/test/java/io/github/utplsql/cli/RunCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
public class RunCommandTest {

private RunCommand createCommand(String... args) {
private RunCommand createRunCommand(String... args) {
RunCommand runCmd = new RunCommand();

JCommander.newBuilder()
Expand All @@ -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<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -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<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -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<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -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<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();

Expand All @@ -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");

Expand Down