Easier MariaDB support in tests
This commit is contained in:
parent
5abe06a2b7
commit
6a75aec6d8
5 changed files with 30 additions and 0 deletions
|
@ -46,3 +46,20 @@ Stop PostgreSQL:
|
||||||
|
|
||||||
docker rm -f postgres
|
docker rm -f postgres
|
||||||
|
|
||||||
|
MariaDB
|
||||||
|
-------
|
||||||
|
|
||||||
|
The simplest way to test with MariaDB is to use the official [MariaDB docker image](https://registry.hub.docker.com/_/mariadb/).
|
||||||
|
|
||||||
|
Start MariaDB:
|
||||||
|
|
||||||
|
docker run --name mariadb -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=keycloak -e MYSQL_USER=keycloak -e MYSQL_PASSWORD=keycloak -d mariadb:10.1
|
||||||
|
|
||||||
|
Run tests:
|
||||||
|
|
||||||
|
mvn install -Dkeycloak.connectionsJpa.url=jdbc:mariadb://`docker inspect --format '{{ .NetworkSettings.IPAddress }}' mariadb`/keycloak -Dkeycloak.connectionsJpa.driver=org.mariadb.jdbc.Driver -Dkeycloak.connectionsJpa.user=keycloak -Dkeycloak.connectionsJpa.password=keycloak
|
||||||
|
|
||||||
|
Stop MySQl:
|
||||||
|
|
||||||
|
docker rm -f mariadb
|
||||||
|
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -86,6 +86,7 @@
|
||||||
<osgi.version>4.2.0</osgi.version>
|
<osgi.version>4.2.0</osgi.version>
|
||||||
<pax.web.version>3.1.2</pax.web.version>
|
<pax.web.version>3.1.2</pax.web.version>
|
||||||
<postgresql.version>9.3-1100-jdbc41</postgresql.version>
|
<postgresql.version>9.3-1100-jdbc41</postgresql.version>
|
||||||
|
<mariadb.version>1.3.7</mariadb.version>
|
||||||
<servlet.api.30.version>1.0.2.Final</servlet.api.30.version>
|
<servlet.api.30.version>1.0.2.Final</servlet.api.30.version>
|
||||||
<twitter4j.version>4.0.4</twitter4j.version>
|
<twitter4j.version>4.0.4</twitter4j.version>
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ public class ServerInfoTest extends AbstractKeycloakTest {
|
||||||
assertEquals(Version.VERSION, info.getSystemInfo().getVersion());
|
assertEquals(Version.VERSION, info.getSystemInfo().getVersion());
|
||||||
assertNotNull(info.getSystemInfo().getServerTime());
|
assertNotNull(info.getSystemInfo().getServerTime());
|
||||||
assertNotNull(info.getSystemInfo().getUptime());
|
assertNotNull(info.getSystemInfo().getUptime());
|
||||||
|
|
||||||
|
log.infof("JPA Connections provider info: %s", info.getProviders().get("connectionsJpa").getProviders().get("default").getOperationalInfo().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -868,6 +868,11 @@
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
<version>${postgresql.version}</version>
|
<version>${postgresql.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
|
<version>${mariadb.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -250,6 +250,11 @@
|
||||||
<artifactId>postgresql</artifactId>
|
<artifactId>postgresql</artifactId>
|
||||||
<version>${postgresql.version}</version>
|
<version>${postgresql.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mariadb.jdbc</groupId>
|
||||||
|
<artifactId>mariadb-java-client</artifactId>
|
||||||
|
<version>${mariadb.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
|
|
Loading…
Reference in a new issue