-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the need for Docker for a default run [take 2] #386
Changes from 9 commits
725516d
fc8c418
6a9f846
3b70a65
b0f906d
3bedf8d
8f8c3a9
a5b96f5
fe5f9ab
e45d6a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, in the end, the idea would be to have the possibility to inject a logger here, e.g. when you are in a Maven build, you could get the Maven logger and log the info properly. For now, we don't have anything better than this. |
||
} 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; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build section could mention some details from description of this PR:
MariaDB and PostgreSQL examples are built by default but not tested. You need to use
-Dtest-postgresql
and
-Dtest-mariadb
to enable testing (+-Ddocker
if you want to rely on the Docker containers).The strict example is executed with H2 by default but can be executed with PostgreSQL using
-Dtest-postgresql
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wasn't sure we should enter into this level of details here. @cescoffier WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if these instructions should not be added to the README of these modules. If we add all the details for all modules, it would quickly become out of track.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a README.md in each example explaining how to run the tests.