This is an automated email from the ASF dual-hosted git repository.
lujingshang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9b98e004929 Support bitronix and narayana transaction testing (#19628)
9b98e004929 is described below
commit 9b98e00492970aafbf2593052b49c9b52ca85614
Author: ZhangCheng <[email protected]>
AuthorDate: Tue Aug 2 13:09:39 2022 +0800
Support bitronix and narayana transaction testing (#19628)
* Support bitronix and narayana transaction testing
* Support bitronix and narayana transaction testing
* Split test cases by transaction provider type to avoid docker
`non-overlapping IPv4 address pool among the defaults to assign to the network`
* Adjust transaction test timeout and steps
* Simplify test cases, investigate problems
* Modify workflows
* Modify workflows
* Fix checkstyle
* Modify workflow
* Fix docker build error by duplicate conf
* Use master it transaction config
---
.github/workflows/it-transaction.yml | 32 +++++++++++----
.../Dockerfile | 1 -
.../pom.xml | 45 +++++++++++++++++++++-
.../src/test/assembly/conf/jbossts-properties.xml | 42 ++++++++++++++++++++
.../assembly/shardingsphere-proxy-assembly.xml | 5 +++
.../pom.xml | 39 +++++++++++++++++++
.../transaction/engine/base/BaseITCase.java | 28 +++++++++++++-
.../engine/base/BaseTransactionITCase.java | 7 ++--
.../engine/command/CommonSQLCommand.java | 4 +-
.../engine/mysql/MySQLProxyTransactionIT.java | 2 +-
.../opengauss/OpenGaussProxyTransactionIT.java | 2 +-
.../postgresql/PostgreSQLProxyTransactionIT.java | 2 +-
.../env/IntegrationTestEnvironment.java | 4 ++
.../container/compose/DockerComposedContainer.java | 13 ++++++-
.../proxy/ShardingSphereProxyDockerContainer.java | 6 ---
.../framework/param/TransactionParameterized.java | 4 +-
.../src/test/resources/env/common/command.xml | 4 +-
...ng-xa.yaml => config-sharding-xa-atomikos.yaml} | 0
...ng-xa.yaml => config-sharding-xa-bitronix.yaml} | 2 +-
...ng-xa.yaml => config-sharding-xa-narayana.yaml} | 2 +-
...ng-xa.yaml => config-sharding-xa-atomikos.yaml} | 0
.../config-sharding-xa-bitronix.yaml} | 2 +-
.../config-sharding-xa-narayana.yaml} | 2 +-
...ng-xa.yaml => config-sharding-xa-atomikos.yaml} | 0
.../config-sharding-xa-bitronix.yaml} | 2 +-
.../config-sharding-xa-narayana.yaml} | 2 +-
.../resources/env/transaction-it-env.properties | 2 +
.../src/test/resources/jbossts-properties.xml | 42 ++++++++++++++++++++
28 files changed, 259 insertions(+), 37 deletions(-)
diff --git a/.github/workflows/it-transaction.yml
b/.github/workflows/it-transaction.yml
index d1b2a573b8d..36a93410952 100644
--- a/.github/workflows/it-transaction.yml
+++ b/.github/workflows/it-transaction.yml
@@ -49,7 +49,7 @@ jobs:
postgresql_version: postgres:12-alpine
opengauss_version: enmotech/opengauss:2.1.0
mysql_version: 5.7
- timeout-minutes: 60
+ timeout-minutes: 120
steps:
- uses: actions/checkout@v3
- name: Cache Maven Repos
@@ -64,9 +64,27 @@ jobs:
java-version: 8
- name: Build Transaction IT image
run: ./mvnw -B clean install -am -pl
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction
-Pit.env.docker -DskipTests
- - name: Run Transaction MySQL Integration Test
- run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.docker.mysql.version=${{
env.mysql_version }}
- - name: Run Transaction PostgreSQL Integration Test
- run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker
-Dtransaction.it.docker.postgresql.version=${{ env.postgresql_version }}
- - name: Run Transaction OpenGauss Integration Test
- run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.docker.opengauss.version=${{
env.opengauss_version }}
+ - name: Run MySQL Local Transaction Integration Test
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=LOCAL
-Dtransaction.it.docker.mysql.version=${{ env.mysql_version }}
+ - name: Run Transaction MySQL Integration Test With Atomikos
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Atomikos
-Dtransaction.it.docker.mysql.version=${{ env.mysql_version }}
+ - name: Run Transaction MySQL Integration Test With Bitronix
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Bitronix
-Dtransaction.it.docker.mysql.version=${{ env.mysql_version }}
+ - name: Run Transaction MySQL Integration Test With Narayana
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Narayana
-Dtransaction.it.docker.mysql.version=${{ env.mysql_version }}
+ - name: Run PostgreSQL Local Transaction Integration Test
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=LOCAL
-Dtransaction.it.docker.postgresql.version=${{ env.postgresql_version }}
+ - name: Run Transaction PostgreSQL Integration Test With Atomikos
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Atomikos
-Dtransaction.it.docker.postgresql.version=${{ env.postgresql_version }}
+ - name: Run Transaction PostgreSQL Integration Test With Bitronix
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Bitronix
-Dtransaction.it.docker.postgresql.version=${{ env.postgresql_version }}
+ - name: Run Transaction PostgreSQL Integration Test With Narayana
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Narayana
-Dtransaction.it.docker.postgresql.version=${{ env.postgresql_version }}
+ - name: Run OpenGauss Local Transaction Integration Test
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=LOCAL
-Dtransaction.it.docker.opengauss.version=${{ env.opengauss_version }}
+ - name: Run Transaction OpenGauss Integration Test With Atomikos
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Atomikos
-Dtransaction.it.docker.opengauss.version=${{ env.opengauss_version }}
+ - name: Run Transaction OpenGauss Integration Test With Bitronix
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Bitronix
-Dtransaction.it.docker.opengauss.version=${{ env.opengauss_version }}
+ - name: Run Transaction OpenGauss Integration Test With Narayana
+ run: ./mvnw -nsu -B install -f
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
-Dtransaction.it.env.type=docker -Dtransaction.it.env.transtypes=XA
-Dtransaction.it.env.xa.providers=Narayana
-Dtransaction.it.docker.opengauss.version=${{ env.opengauss_version }}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/Dockerfile
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/Dockerfile
index c8cd9a1bbef..6b069433c82 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/Dockerfile
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/Dockerfile
@@ -29,7 +29,6 @@ WORKDIR /opt/shardingsphere-proxy
RUN cat bin/start.sh | tr -d '\r' > _start.sh && mv _start.sh bin/start.sh
RUN cat bin/stop.sh | tr -d '\r' > _stop.sh && mv _stop.sh bin/stop.sh
-RUN cat conf/logback.xml | tr -d '\r' > _logback.xml && mkdir conf && mv
_logback.xml conf/logback.xml
RUN chmod +x -R ./bin
CMD /opt/shardingsphere-proxy/bin/start.sh && tail -f
/opt/shardingsphere-proxy/logs/stdout.log
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/pom.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/pom.xml
index 3ece856efce..d3d3d410424 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/pom.xml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/pom.xml
@@ -30,6 +30,10 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<dockerfile.skip.build>true</dockerfile.skip.build>
+ <narayana.version>5.12.4.Final</narayana.version>
+
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
+ <jboss-logging.version>3.2.1.Final</jboss-logging.version>
+ <btm.version>2.1.3</btm.version>
</properties>
<dependencies>
@@ -53,7 +57,6 @@
<artifactId>shardingsphere-jdbc-core</artifactId>
<version>${project.version}</version>
</dependency>
-
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
@@ -87,6 +90,46 @@
<artifactId>logback-classic</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-transaction-xa-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.narayana.jta</groupId>
+ <artifactId>jta</artifactId>
+ <version>${narayana.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.narayana.jts</groupId>
+ <artifactId>narayana-jts-integration</artifactId>
+ <version>${narayana.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <version>${jboss-transaction-spi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>${jboss-logging.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.btm</groupId>
+ <artifactId>btm</artifactId>
+ <version>${btm.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/conf/jbossts-properties.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/conf/jbossts-properties.xml
new file mode 100644
index 00000000000..7df6ab2e2ab
--- /dev/null
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/conf/jbossts-properties.xml
@@ -0,0 +1,42 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<properties>
+ <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
+ <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
+ <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
+ <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
+ <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
+
com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
+
com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
+
com.arjuna.ats.internal.jta.recovery.arjunacore.JTAActionStatusServiceXAResourceOrphanFilter
+ </entry>
+ <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
+ com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
+ com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
+ </entry>
+ <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
+
com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
+ </entry>
+ <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
+ <entry
key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.recoveryListener">NO</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryBackoffPeriod">1</entry>
+</properties>
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/shardingsphere-proxy-assembly.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/shardingsphere-proxy-assembly.xml
index 7cd27a7a121..b28ed384bab 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/shardingsphere-proxy-assembly.xml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-fixture/src/test/assembly/shardingsphere-proxy-assembly.xml
@@ -29,6 +29,11 @@
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</fileSet>
+ <fileSet>
+ <directory>src/test/assembly/conf</directory>
+ <outputDirectory>conf</outputDirectory>
+ <fileMode>0644</fileMode>
+ </fileSet>
</fileSets>
<files>
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
index c2d48a6dc0f..4af31138b4e 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/pom.xml
@@ -30,6 +30,10 @@
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
<atomikos.version>5.0.8</atomikos.version>
+ <narayana.version>5.12.4.Final</narayana.version>
+
<jboss-transaction-spi.version>7.6.0.Final</jboss-transaction-spi.version>
+ <jboss-logging.version>3.2.1.Final</jboss-logging.version>
+ <btm.version>2.1.3</btm.version>
</properties>
<dependencies>
@@ -106,6 +110,41 @@
<artifactId>transactions-jdbc</artifactId>
<version>${atomikos.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-transaction-xa-narayana</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.narayana.jta</groupId>
+ <artifactId>jta</artifactId>
+ <version>${narayana.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.narayana.jts</groupId>
+ <artifactId>narayana-jts-integration</artifactId>
+ <version>${narayana.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-transaction-spi</artifactId>
+ <version>${jboss-transaction-spi.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging</artifactId>
+ <version>${jboss-logging.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-transaction-xa-bitronix</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.btm</groupId>
+ <artifactId>btm</artifactId>
+ <version>${btm.version}</version>
+ </dependency>
</dependencies>
<build>
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
index f102f4695c2..08eb2eb79a6 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseITCase.java
@@ -87,6 +87,8 @@ public abstract class BaseITCase {
protected static final Collection<String> ALL_DS = Arrays.asList(DS_0,
DS_1, DS_2);
+ protected static final Collection<String> ALL_XA_PROVIDERS =
Arrays.asList(TransactionTestConstants.ATOMIKOS,
TransactionTestConstants.BITRONIX, TransactionTestConstants.NARAYANA);
+
protected static final String SHARDING_DB = "sharding_db";
private static final List<Class<? extends BaseTransactionTestCase>>
TEST_CASES;
@@ -210,11 +212,33 @@ public abstract class BaseITCase {
log.info("Collect transaction test case, need to run
transaction types don't contain this, skip: {}-{}.", caseClass.getName(), each);
continue;
}
- result.add(new
TransactionParameterized(getSqlDatabaseType(currentTestCaseInfo.getDbType()),
currentTestCaseInfo.getRunningAdaptor(), each,
- getDockerImageName(currentTestCaseInfo.getDbType(),
version), caseClass));
+ addParametersByTransactionProviders(result, version,
currentTestCaseInfo, caseClass, each);
}
}
+ private static void addParametersByTransactionProviders(final
Collection<TransactionParameterized> result, final String version, final
TransactionTestCaseRegistry currentTestCaseInfo,
+ final Class<?
extends BaseTransactionTestCase> caseClass, final TransactionType each) {
+ if (TransactionType.LOCAL.equals(each)) {
+ result.add(createTransactionParameter(version,
currentTestCaseInfo, caseClass, each, ""));
+ } else if (TransactionType.XA.equals(each)) {
+ if (ENV.getAllowXAProviders().isEmpty()) {
+ for (String provider : ALL_XA_PROVIDERS) {
+ result.add(createTransactionParameter(version,
currentTestCaseInfo, caseClass, each, provider));
+ }
+ } else {
+ for (String provider : ENV.getAllowXAProviders()) {
+ result.add(createTransactionParameter(version,
currentTestCaseInfo, caseClass, each, provider));
+ }
+ }
+ }
+ }
+
+ private static TransactionParameterized createTransactionParameter(final
String version, final TransactionTestCaseRegistry currentTestCaseInfo,
+ final
Class<? extends BaseTransactionTestCase> caseClass, final TransactionType
transactionType, final String provider) {
+ return new
TransactionParameterized(getSqlDatabaseType(currentTestCaseInfo.getDbType()),
currentTestCaseInfo.getRunningAdaptor(), transactionType, provider,
+ getDockerImageName(currentTestCaseInfo.getDbType(), version),
caseClass);
+ }
+
private static DatabaseType getSqlDatabaseType(final String databaseType) {
switch (databaseType) {
case TransactionTestConstants.MYSQL:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
index 64f5b43600c..e9d39ddab13 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/base/BaseTransactionITCase.java
@@ -154,14 +154,13 @@ public abstract class BaseTransactionITCase extends
BaseITCase {
assertTrue(waitExpectedTransactionRule(TransactionType.LOCAL, "", 5));
}
- protected void alterXaTransactionRule() throws SQLException {
- String providerType = TransactionTestConstants.ATOMIKOS;
+ protected void alterXaTransactionRule(final String providerType) throws
SQLException {
Connection connection = getProxyConnection();
if (isExpectedTransactionRule(connection, TransactionType.XA,
providerType)) {
return;
}
- String alterXaAtomikosTransactionRule =
getCommonSQLCommand().getAlterXaAtomikosTransactionRule().replace("${providerType}",
providerType);
- executeWithLog(connection, alterXaAtomikosTransactionRule);
+ String alterXaTransactionRule =
getCommonSQLCommand().getAlterXATransactionRule().replace("${providerType}",
providerType);
+ executeWithLog(connection, alterXaTransactionRule);
assertTrue(waitExpectedTransactionRule(TransactionType.XA,
providerType, 5));
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CommonSQLCommand.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CommonSQLCommand.java
index 75c1e4dc779..a516bd5574a 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CommonSQLCommand.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/command/CommonSQLCommand.java
@@ -62,8 +62,8 @@ public final class CommonSQLCommand {
@XmlElement(name = "alter-local-transaction-rule")
private String alterLocalTransactionRule;
- @XmlElement(name = "alter-xa-atomikos-transaction-rule")
- private String alterXaAtomikosTransactionRule;
+ @XmlElement(name = "alter-xa-transaction-rule")
+ private String alterXATransactionRule;
@XmlElement(name = "source-add-resource-template")
private String sourceAddResourceTemplate;
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/mysql/MySQLProxyTransactionIT.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/mysql/MySQLProxyTransactionIT.java
index b6797ee9bc0..a10551f95c7 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/mysql/MySQLProxyTransactionIT.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/mysql/MySQLProxyTransactionIT.java
@@ -62,7 +62,7 @@ public final class MySQLProxyTransactionIT extends
BaseTransactionITCase {
if (Objects.equals(parameterized.getTransactionType(),
TransactionType.LOCAL)) {
alterLocalTransactionRule();
} else if (Objects.equals(parameterized.getTransactionType(),
TransactionType.XA)) {
- alterXaTransactionRule();
+ alterXaTransactionRule(parameterized.getProvider());
}
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/opengauss/OpenGaussProxyTransactionIT.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/opengauss/OpenGaussProxyTransactionIT.java
index e422471696c..30bc28e8af2 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/opengauss/OpenGaussProxyTransactionIT.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/opengauss/OpenGaussProxyTransactionIT.java
@@ -62,7 +62,7 @@ public final class OpenGaussProxyTransactionIT extends
BaseTransactionITCase {
if (Objects.equals(parameterized.getTransactionType(),
TransactionType.LOCAL)) {
alterLocalTransactionRule();
} else if (Objects.equals(parameterized.getTransactionType(),
TransactionType.XA)) {
- alterXaTransactionRule();
+ alterXaTransactionRule(parameterized.getProvider());
}
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/postgresql/PostgreSQLProxyTransactionIT.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/postgresql/PostgreSQLProxyTransactionIT.java
index acab6ab9fea..c0b4a2e29d7 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/postgresql/PostgreSQLProxyTransactionIT.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/engine/postgresql/PostgreSQLProxyTransactionIT.java
@@ -62,7 +62,7 @@ public final class PostgreSQLProxyTransactionIT extends
BaseTransactionITCase {
if (Objects.equals(parameterized.getTransactionType(),
TransactionType.LOCAL)) {
alterLocalTransactionRule();
} else if (Objects.equals(parameterized.getTransactionType(),
TransactionType.XA)) {
- alterXaTransactionRule();
+ alterXaTransactionRule(parameterized.getProvider());
}
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
index c35852fe2be..c79adfdb684 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/env/IntegrationTestEnvironment.java
@@ -55,6 +55,8 @@ public final class IntegrationTestEnvironment {
private final List<String> allowTransactionTypes;
+ private final List<String> allowXAProviders;
+
private final Map<String, TransactionTestCaseRegistry>
transactionTestCaseRegistryMap;
private IntegrationTestEnvironment() {
@@ -65,6 +67,8 @@ public final class IntegrationTestEnvironment {
openGaussVersions =
splitProperty("transaction.it.docker.opengauss.version");
needToRunTestCases = splitProperty("transaction.it.env.cases");
allowTransactionTypes = splitProperty("transaction.it.env.transtypes");
+ allowXAProviders = splitProperty("transaction.it.env.xa.providers");
+ log.info("Loaded properties, allowTransactionTypes:{},
allowXAProviders:{}", allowTransactionTypes, allowXAProviders);
transactionTestCaseRegistryMap = initTransactionTestCaseRegistryMap();
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerComposedContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerComposedContainer.java
index 90a025e5c43..ad18a848d61 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerComposedContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/compose/DockerComposedContainer.java
@@ -17,6 +17,7 @@
package
org.apache.shardingsphere.integration.transaction.framework.container.compose;
+import com.google.common.base.Strings;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
@@ -67,12 +68,20 @@ public final class DockerComposedContainer extends
BaseComposedContainer {
}
private String getShardingSphereConfigResource(final
TransactionParameterized parameterized) {
- String result = String.format("env/%s/%s/config-sharding-%s.yaml",
parameterized.getAdapter().toLowerCase(),
- parameterized.getDatabaseType().getType().toLowerCase(),
parameterized.getTransactionType().toString().toLowerCase());
+ String result = String.format("env/%s/%s/config-sharding-%s%s.yaml",
parameterized.getAdapter().toLowerCase(),
+ parameterized.getDatabaseType().getType().toLowerCase(),
parameterized.getTransactionType().toString().toLowerCase(),
getTransactionProvider(parameterized.getProvider()));
log.info("Transaction IT tests use the configuration file: {}",
result);
return result;
}
+ private String getTransactionProvider(final String providerType) {
+ if (Strings.isNullOrEmpty(providerType)) {
+ return "";
+ } else {
+ return "-" + providerType.toLowerCase();
+ }
+ }
+
@Override
public void stop() {
super.stop();
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
index ce5ec0c5cd6..bbb283be4e2 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/container/proxy/ShardingSphereProxyDockerContainer.java
@@ -19,8 +19,6 @@ package
org.apache.shardingsphere.integration.transaction.framework.container.pr
import lombok.extern.slf4j.Slf4j;
import org.apache.shardingsphere.infra.database.type.DatabaseType;
-import
org.apache.shardingsphere.integration.transaction.env.IntegrationTestEnvironment;
-import
org.apache.shardingsphere.integration.transaction.env.enums.TransactionITEnvTypeEnum;
import org.apache.shardingsphere.integration.transaction.util.DatabaseTypeUtil;
import
org.apache.shardingsphere.test.integration.env.container.atomic.DockerITContainer;
import
org.apache.shardingsphere.test.integration.env.container.wait.JDBCConnectionWaitStrategy;
@@ -56,10 +54,6 @@ public final class ShardingSphereProxyDockerContainer
extends DockerITContainer
private void mapConfigurationFiles() {
withClasspathResourceMapping(String.format("/env/%s/server.yaml",
databaseType.getType().toLowerCase()),
"/opt/shardingsphere-proxy/conf/server.yaml", BindMode.READ_ONLY);
withClasspathResourceMapping("/logback-test.xml",
"/opt/shardingsphere-proxy/conf/logback-test.xml", BindMode.READ_ONLY);
- if (TransactionITEnvTypeEnum.NATIVE ==
IntegrationTestEnvironment.getInstance().getItEnvType()) {
- addFixedExposedPort(3307, 3307);
- addFixedExposedPort(5005, 3308);
- }
}
@Override
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/param/TransactionParameterized.java
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/param/TransactionParameterized.java
index b7cabb9d7fc..a6532f429f9 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/param/TransactionParameterized.java
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/java/org/apache/shardingsphere/integration/transaction/framework/param/TransactionParameterized.java
@@ -36,12 +36,14 @@ public final class TransactionParameterized {
private final TransactionType transactionType;
+ private final String provider;
+
private final String dockerImageName;
private final Class<? extends BaseTransactionTestCase>
transactionTestCaseClass;
@Override
public String toString() {
- return String.format("%s -> %s -> %s -> %s -> %s",
databaseType.getType(), adapter, transactionType, dockerImageName,
transactionTestCaseClass.getSimpleName());
+ return String.format("%s -> %s -> %s -> %s -> %s -> %s",
databaseType.getType(), adapter, transactionType, provider, dockerImageName,
transactionTestCaseClass.getSimpleName());
}
}
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
index b8403d17daf..6d3e41c49c8 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/common/command.xml
@@ -93,13 +93,13 @@
ALTER TRANSACTION RULE ( DEFAULT=LOCAL )
</alter-local-transaction-rule>
- <alter-xa-atomikos-transaction-rule>
+ <alter-xa-transaction-rule>
ALTER TRANSACTION RULE
(
DEFAULT=XA,
TYPE(NAME=${providerType})
)
- </alter-xa-atomikos-transaction-rule>
+ </alter-xa-transaction-rule>
<source-add-resource-template>
ADD RESOURCE ds_0 (
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml
similarity index 100%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-atomikos.yaml
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml
similarity index 99%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml
index d76760f284d..63a50867e42 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-bitronix.yaml
@@ -25,7 +25,7 @@ databaseName: sharding_db
rules:
- !TRANSACTION
defaultType: XA
- providerType: Atomikos
+ providerType: Bitronix
- !SHARDING
tables:
t_order:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-narayana.yaml
similarity index 99%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-narayana.yaml
index d76760f284d..ed00975db3c 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa-narayana.yaml
@@ -25,7 +25,7 @@ databaseName: sharding_db
rules:
- !TRANSACTION
defaultType: XA
- providerType: Atomikos
+ providerType: Narayana
- !SHARDING
tables:
t_order:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml
similarity index 100%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa.yaml
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-atomikos.yaml
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml
similarity index 99%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml
index d76760f284d..63a50867e42 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-bitronix.yaml
@@ -25,7 +25,7 @@ databaseName: sharding_db
rules:
- !TRANSACTION
defaultType: XA
- providerType: Atomikos
+ providerType: Bitronix
- !SHARDING
tables:
t_order:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml
similarity index 99%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml
index d76760f284d..ed00975db3c 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/opengauss/config-sharding-xa-narayana.yaml
@@ -25,7 +25,7 @@ databaseName: sharding_db
rules:
- !TRANSACTION
defaultType: XA
- providerType: Atomikos
+ providerType: Narayana
- !SHARDING
tables:
t_order:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml
similarity index 100%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa.yaml
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-atomikos.yaml
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml
similarity index 99%
copy from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
copy to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml
index d76760f284d..63a50867e42 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-bitronix.yaml
@@ -25,7 +25,7 @@ databaseName: sharding_db
rules:
- !TRANSACTION
defaultType: XA
- providerType: Atomikos
+ providerType: Bitronix
- !SHARDING
tables:
t_order:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml
similarity index 99%
rename from
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
rename to
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml
index d76760f284d..ed00975db3c 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/mysql/config-sharding-xa.yaml
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/jdbc/postgresql/config-sharding-xa-narayana.yaml
@@ -25,7 +25,7 @@ databaseName: sharding_db
rules:
- !TRANSACTION
defaultType: XA
- providerType: Atomikos
+ providerType: Narayana
- !SHARDING
tables:
t_order:
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
index cc99b538141..df6fee6d852 100644
---
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/env/transaction-it-env.properties
@@ -20,6 +20,8 @@ transaction.it.env.type=
transaction.it.env.cases=PostgresSQLAutoCommitTestCase,
MultiTableCommitAndRollbackTestCase, SingleTableCommitAndRollbackTestCase,
MySQLSetReadOnlyTestCase, MySQLSavePointTestCase, AddResourceTestCase,
CloseResourceTestCase
# transaction.it.env.transtypes=LOCAL, XA, BASE
transaction.it.env.transtypes=LOCAL, XA
+# transaction.it.env.xa.providers=Atomikos, Bitronix, Narayana
+transaction.it.env.xa.providers=
# transaction.it.docker.mysql.version=5.7,8.0
transaction.it.docker.mysql.version=
#
transaction.it.docker.postgresql.version=postgres:10-alpine,postgres:11-alpine,postgres:12-alpine,postgres:13-alpine,postgres:14-alpine
diff --git
a/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/jbossts-properties.xml
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/jbossts-properties.xml
new file mode 100644
index 00000000000..7df6ab2e2ab
--- /dev/null
+++
b/shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-transaction/src/test/resources/jbossts-properties.xml
@@ -0,0 +1,42 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<properties>
+ <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
+ <entry key="ObjectStoreEnvironmentBean.transactionSync">ON</entry>
+ <entry key="CoreEnvironmentBean.nodeIdentifier">1</entry>
+ <entry key="JTAEnvironmentBean.xaRecoveryNodes">1</entry>
+ <entry key="JTAEnvironmentBean.xaResourceOrphanFilterClassNames">
+
com.arjuna.ats.internal.jta.recovery.arjunacore.JTATransactionLogXAResourceOrphanFilter
+
com.arjuna.ats.internal.jta.recovery.arjunacore.JTANodeNameXAResourceOrphanFilter
+
com.arjuna.ats.internal.jta.recovery.arjunacore.JTAActionStatusServiceXAResourceOrphanFilter
+ </entry>
+ <entry key="CoreEnvironmentBean.socketProcessIdPort">0</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryModuleClassNames">
+ com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule
+ com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule
+ </entry>
+ <entry key="RecoveryEnvironmentBean.expiryScannerClassNames">
+
com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner
+ </entry>
+ <entry key="RecoveryEnvironmentBean.recoveryPort">4712</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.transactionStatusManagerPort">0</entry>
+ <entry
key="RecoveryEnvironmentBean.transactionStatusManagerAddress"></entry>
+ <entry key="RecoveryEnvironmentBean.recoveryListener">NO</entry>
+ <entry key="RecoveryEnvironmentBean.recoveryBackoffPeriod">1</entry>
+</properties>