-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #386 from gsmet/no-docker-take-2
Remove the need for Docker for a default run [take 2]
- Loading branch information
Showing
32 changed files
with
877 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 0 additions & 42 deletions
42
...jpa-h2/src/test/java/org/jboss/shamrock/example/testutils/H2DatabaseLifecycleManager.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...est/java/org/jboss/shamrock/example/testutils/H2DatabaseTestResourceLifecycleManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.jboss.shamrock.example.testutils; | ||
|
||
import java.sql.SQLException; | ||
|
||
import org.h2.tools.Server; | ||
import org.jboss.shamrock.test.ShamrockTestResource; | ||
import org.jboss.shamrock.test.ShamrockTestResourceLifecycleManager; | ||
|
||
@ShamrockTestResource(H2DatabaseTestResourceLifecycleManager.class) | ||
public class H2DatabaseTestResourceLifecycleManager implements ShamrockTestResourceLifecycleManager { | ||
|
||
private Server tcpServer; | ||
|
||
@Override | ||
public synchronized void start() { | ||
try { | ||
tcpServer = Server.createTcpServer(); | ||
tcpServer.start(); | ||
System.out.println("[INFO] H2 database started in TCP server mode"); | ||
} catch (SQLException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public synchronized void stop() { | ||
if (tcpServer != null) { | ||
tcpServer.stop(); | ||
System.out.println("[INFO] H2 database was shut down"); | ||
tcpServer = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# JPA example with MariaDB | ||
|
||
## Running the tests | ||
|
||
By default, the tests of this module are disabled. | ||
|
||
To run the tests in a standard JVM with MariaDB started as a Docker container, you can run the following command: | ||
|
||
``` | ||
mvn clean install -Dtest-mariadb -Ddocker | ||
``` | ||
|
||
Additionaly, you can generate a native image and run the tests for this native image by adding `-Dnative`: | ||
|
||
``` | ||
mvn clean install -Dtest-mariadb -Ddocker -Dnative | ||
``` | ||
|
||
If you don't want to run MariaDB as a Docker container, you can start your own MariaDB server. It needs to listen on the default port and have a database called `hibernate_orm_test` accessible to the user `hibernate_orm_test` with the password `hibernate_orm_test`. | ||
|
||
You can then run the tests as follows (either with `-Dnative` or not): | ||
|
||
``` | ||
mvn clean install -Dtest-mariadb | ||
``` | ||
|
||
If you have specific requirements, you can define a specific connection URL with `-Dmariadb.url=jdbc:mariadb://...`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# JPA example with PostgreSQL | ||
|
||
## Running the tests | ||
|
||
By default, the tests of this module are disabled. | ||
|
||
To run the tests in a standard JVM with PostgreSQL started as a Docker container, you can run the following command: | ||
|
||
``` | ||
mvn clean install -Dtest-postgresql -Ddocker | ||
``` | ||
|
||
Additionaly, you can generate a native image and run the tests for this native image by adding `-Dnative`: | ||
|
||
``` | ||
mvn clean install -Dtest-postgresql -Ddocker -Dnative | ||
``` | ||
|
||
If you don't want to run PostgreSQL as a Docker container, you can start your own PostgreSQL server. It needs to listen on the default port and have a database called `hibernate_orm_test` accessible to the user `hibernate_orm_test` with the password `hibernate_orm_test`. | ||
|
||
You can then run the tests as follows (either with `-Dnative` or not): | ||
|
||
``` | ||
mvn clean install -Dtest-postgresql | ||
``` | ||
|
||
If you have specific requirements, you can define a specific connection URL with `-Dpostgres.url=jdbc:postgresql://...`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.