-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for using Agroal Datasources in hibernate
If persistence.xml does not have a connection URL defined then the Agroal datasource will be used instead.
- Loading branch information
1 parent
5d48738
commit a41233b
Showing
17 changed files
with
91 additions
and
304 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
83 changes: 0 additions & 83 deletions
83
...trict/src/main/java/org/jboss/shamrock/example/datasource/DatabaseManagerReplacement.java
This file was deleted.
Oops, something went wrong.
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
115 changes: 0 additions & 115 deletions
115
...les/strict/src/main/java/org/jboss/shamrock/example/datasource/HSQLDriverReplacement.java
This file was deleted.
Oops, something went wrong.
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
6 changes: 4 additions & 2 deletions
6
examples/strict/src/main/resources/META-INF/shamrock-build.yaml
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
datasource: | ||
url: "jdbc:hsqldb:hsql://localhost:7676/test" | ||
driver: "org.hsqldb.jdbc.JDBCDriver" | ||
url: ${postgres.url} | ||
driver: "org.postgresql.Driver" | ||
username: "hibernate_orm_test" | ||
password: "hibernate_orm_test" |
9 changes: 9 additions & 0 deletions
9
...les/strict/src/test/java/org/jboss/shamrock/example/test/DataSourceTransactionITCase.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,9 @@ | ||
package org.jboss.shamrock.example.test; | ||
|
||
import org.jboss.shamrock.junit.GraalTest; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(GraalTest.class) | ||
public class DataSourceTransactionITCase extends DataSourceTransactionTestCase { | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
...s/strict/src/test/java/org/jboss/shamrock/example/test/DataSourceTransactionTestCase.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,30 @@ | ||
package org.jboss.shamrock.example.test; | ||
|
||
import org.jboss.shamrock.example.testutils.URLResponse; | ||
import org.jboss.shamrock.example.testutils.URLTester; | ||
import org.jboss.shamrock.junit.ShamrockTest; | ||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
@RunWith(ShamrockTest.class) | ||
public class DataSourceTransactionTestCase { | ||
|
||
@Test | ||
public void testTransactionalAnnotation() { | ||
//TODO: this does not really belong here, but it saves having to set all the DB stuff up again | ||
|
||
Assert.assertEquals("PASSED", URLTester.relative("rest/datasource/txninterceptor0").invokeURL().asString()); | ||
|
||
try { | ||
URLResponse resp = URLTester.relative("rest/datasource/txninterceptor1").invokeURL(); | ||
Assert.fail(resp.asString()); | ||
} catch (RuntimeException expected) { | ||
|
||
} | ||
Assert.assertEquals("PASSED", URLTester.relative("rest/datasource/txninterceptor2").invokeURL().asString()); | ||
|
||
|
||
} | ||
|
||
} |
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.