Skip to content

Commit

Permalink
Enabling use of mysql service in Travis - #22
Browse files Browse the repository at this point in the history
  • Loading branch information
edrdo committed Jun 6, 2017
1 parent 272965e commit f610ed5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ before_install:
- java -version
- echo "MAVEN_OPTS='-Xmx4g -Xss512m'" > ~/.mavenrc
install: true
services:
- mysql
addons:
sonarqube:
organization: "jdbdt"
Expand All @@ -30,4 +32,5 @@ matrix:
env:
- GOALS="clean package site-deploy"
script:
- echo 9999 > $HOME/.my.cnf
- mvn -Djdbdt.site.path=file:///$HOME/jdbdt.org $GOALS
14 changes: 14 additions & 0 deletions src/test/java/org/jdbdt/mysql/MySQLDBSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ public void stop() { }

};

MySQLDBSetup TravisHandler = new MySQLDBSetup() {

@Override
public String start() {
return "jdbc:mysql://localhost:9999/jdbdt?user=travis&password=&useSSL=false&createDatabaseIfNotExist=true";
}

@Override
public void stop() { }
};

MySQLDBSetup EmbeddedHandler = new MySQLDBSetup() {
MysqldResource engine;
static final String DB_PATH = "mysql";
Expand Down Expand Up @@ -67,6 +78,9 @@ static MySQLDBSetup get() {
case AppVeyor:
h = AppVeyorHandler;
break;
case Travis:
h = TravisHandler;
break;
default:
h = EmbeddedHandler;
}
Expand Down

0 comments on commit f610ed5

Please sign in to comment.