Skip to content

Commit d50b8b5

Browse files
authored
Merge pull request #13 from viniciusam/travis_cfg
Fix connection string tests and travis config changes
2 parents e37b738 + 0573f20 commit d50b8b5

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ jdk:
66

77
env:
88
global:
9+
- CACHE_DIR=$HOME/.cache
910
- MAVEN_HOME=/usr/local/maven
1011
- MAVEN_CFG=$HOME/.m2
1112

1213
cache:
1314
directories:
15+
- $CACHE_DIR
1416
- $MAVEN_CFG
15-
- $MAVEN_HOME/lib/ext # Used to cache wagon-http lib.
1617

1718
install:
1819
- bash .travis/maven_cfg.sh

.travis/maven_cfg.sh

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,28 @@
22
set -ev
33
cd $(dirname $(readlink -f $0))
44

5-
if [ -f $MAVEN_CFG/repository ]; then
6-
echo "Using cached maven dependencies..."
7-
exit 0
8-
fi
9-
10-
if [ "$ORACLE_OTN_USER" == "" ] || [ "$ORACLE_OTN_PASSWORD" == "" ]; then
11-
echo "Oracle OTN username/password not specified."
12-
exit 1
13-
fi
14-
155
# Download wagon-http recommended by Oracle.
166
# On maven latest version this is not needed, but travis doesn't have it.
17-
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
18-
sudo mv wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
7+
if [ ! -f $CACHE_DIR/wagon-http-2.8-shaded.jar ]; then
8+
curl -L -O "http://central.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.8/wagon-http-2.8-shaded.jar"
9+
mv wagon-http-2.8-shaded.jar $CACHE_DIR/
10+
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
11+
else
12+
echo "Using cached wagon-http..."
13+
sudo cp $CACHE_DIR/wagon-http-2.8-shaded.jar $MAVEN_HOME/lib/ext/
14+
fi
1915

2016
# Create the settings file with oracle server config.
21-
cp settings.xml $MAVEN_CFG/settings.xml
17+
# If file already exists, Oracle dependencies were cached on previous build.
18+
if [ ! -f $MAVEN_CFG/.cached ]; then
19+
cp settings.xml $MAVEN_CFG/settings.xml
20+
touch $MAVEN_CFG/.cached
21+
else
22+
echo "Using cached maven settings..."
23+
fi
2224

2325
# The Java API is not available on a public repository yet, we need to download and install it locally.
26+
# Always downloading the latest development version.
2427
git clone https://github.com/utPLSQL/utPLSQL-java-api.git
2528
cd utPLSQL-java-api
2629
mvn package install -DskipTests

src/test/java/io/github/utplsql/cli/RunCommandTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
public class RunCommandTest {
1414

15-
private RunCommand createCommand(String... args) {
15+
private RunCommand createRunCommand(String... args) {
1616
RunCommand runCmd = new RunCommand();
1717

1818
JCommander.newBuilder()
@@ -25,7 +25,7 @@ private RunCommand createCommand(String... args) {
2525

2626
@Test
2727
public void reporterOptions_Default() {
28-
RunCommand runCmd = createCommand("run", "app/app");
28+
RunCommand runCmd = createRunCommand("app/app@xe");
2929

3030
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
3131

@@ -38,7 +38,7 @@ public void reporterOptions_Default() {
3838

3939
@Test
4040
public void reporterOptions_OneReporter() {
41-
RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-o=output.txt");
41+
RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-o=output.txt");
4242

4343
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
4444

@@ -51,7 +51,7 @@ public void reporterOptions_OneReporter() {
5151

5252
@Test
5353
public void reporterOptions_OneReporterForceScreen() {
54-
RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-o=output.txt", "-s");
54+
RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-o=output.txt", "-s");
5555

5656
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
5757

@@ -64,7 +64,7 @@ public void reporterOptions_OneReporterForceScreen() {
6464

6565
@Test
6666
public void reporterOptions_OneReporterForceScreenInverse() {
67-
RunCommand runCmd = createCommand("run", "app/app", "-f=ut_documentation_reporter", "-s", "-o=output.txt");
67+
RunCommand runCmd = createRunCommand("app/app@xe", "-f=ut_documentation_reporter", "-s", "-o=output.txt");
6868

6969
List<ReporterOptions> reporterOptionsList = runCmd.getReporterOptionsList();
7070

@@ -77,7 +77,7 @@ public void reporterOptions_OneReporterForceScreenInverse() {
7777

7878
@Test
7979
public void reporterOptions_TwoReporters() {
80-
RunCommand runCmd = createCommand("run", "app/app",
80+
RunCommand runCmd = createRunCommand("app/app@xe",
8181
"-f=ut_documentation_reporter",
8282
"-f=ut_coverage_html_reporter", "-o=coverage.html", "-s");
8383

0 commit comments

Comments
 (0)