-
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 #35242 from gsmet/transaction-manager-fixes
Transaction manager-related backports and fixes
- Loading branch information
Showing
10 changed files
with
146 additions
and
39 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
40 changes: 40 additions & 0 deletions
40
...est/java/io/quarkus/narayana/quarkus/TransactionJdbcObjectStoreValidationFailureTest.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,40 @@ | ||
package io.quarkus.narayana.quarkus; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
import java.util.List; | ||
|
||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import io.quarkus.builder.Version; | ||
import io.quarkus.maven.dependency.Dependency; | ||
import io.quarkus.runtime.configuration.ConfigurationException; | ||
import io.quarkus.runtime.util.ExceptionUtil; | ||
import io.quarkus.test.QuarkusUnitTest; | ||
|
||
public class TransactionJdbcObjectStoreValidationFailureTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest config = new QuarkusUnitTest() | ||
.withApplicationRoot((jar) -> jar | ||
.addAsResource("jdbc-object-store-validation.properties", "application.properties")) | ||
.setForcedDependencies(List.of(Dependency.of("io.quarkus", "quarkus-jdbc-h2", Version.getVersion()))) | ||
.assertException(t -> { | ||
Throwable rootCause = ExceptionUtil.getRootCause(t); | ||
if (rootCause instanceof ConfigurationException) { | ||
assertTrue(rootCause.getMessage().contains( | ||
"The Narayana JTA extension is configured to use the datasource 'test' but that datasource is not configured.")); | ||
} else { | ||
fail(t); | ||
} | ||
}); | ||
|
||
@Test | ||
public void test() { | ||
// needs to be there in order to run test | ||
Assertions.fail("Application was supposed to fail."); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...nsions/narayana-jta/deployment/src/test/resources/jdbc-object-store-validation.properties
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 @@ | ||
quarkus.transaction-manager.object-store.type=jdbc | ||
quarkus.transaction-manager.object-store.datasource=test | ||
quarkus.datasource.test.db-kind=h2 | ||
quarkus.datasource.test.jdbc.url=jdbc:h2:mem:default | ||
quarkus.datasource.test.jdbc.transactions=xa | ||
|
||
# we must not start database as CI is also executed on Windows without (Docker) Linux containers | ||
quarkus.datasource.devservices.enabled=false | ||
quarkus.devservices.enabled=false |
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
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