diff --git a/misc/DatabaseTesting.md b/misc/DatabaseTesting.md index 07feccb465..02eb365246 100644 --- a/misc/DatabaseTesting.md +++ b/misc/DatabaseTesting.md @@ -45,4 +45,21 @@ Run tests: Stop PostgreSQL: 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 diff --git a/pom.xml b/pom.xml index e9f3a35feb..ff731e98c0 100755 --- a/pom.xml +++ b/pom.xml @@ -86,6 +86,7 @@ 4.2.0 3.1.2 9.3-1100-jdbc41 + 1.3.7 1.0.2.Final 4.0.4 diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java index 5e1a041b44..ae17a70223 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/admin/ServerInfoTest.java @@ -57,6 +57,8 @@ public class ServerInfoTest extends AbstractKeycloakTest { assertEquals(Version.VERSION, info.getSystemInfo().getVersion()); assertNotNull(info.getSystemInfo().getServerTime()); assertNotNull(info.getSystemInfo().getUptime()); + + log.infof("JPA Connections provider info: %s", info.getProviders().get("connectionsJpa").getProviders().get("default").getOperationalInfo().toString()); } @Override diff --git a/testsuite/integration-arquillian/tests/pom.xml b/testsuite/integration-arquillian/tests/pom.xml index fab614b91b..f701f5c6bd 100755 --- a/testsuite/integration-arquillian/tests/pom.xml +++ b/testsuite/integration-arquillian/tests/pom.xml @@ -868,6 +868,11 @@ postgresql ${postgresql.version} + + org.mariadb.jdbc + mariadb-java-client + ${mariadb.version} + diff --git a/testsuite/integration/pom.xml b/testsuite/integration/pom.xml index 7ddb2bcebb..362d749a28 100755 --- a/testsuite/integration/pom.xml +++ b/testsuite/integration/pom.xml @@ -250,6 +250,11 @@ postgresql ${postgresql.version} + + org.mariadb.jdbc + mariadb-java-client + ${mariadb.version} +