This is an automated email from the ASF dual-hosted git repository.

zhangliang 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 156b819ce9f Remove the use of jbossts-properties.xml in nativeTest via 
Narayana Java API (#30102)
156b819ce9f is described below

commit 156b819ce9f678b2042969bd83db397b39df21d8
Author: Ling Hengqian <[email protected]>
AuthorDate: Tue Feb 13 13:39:25 2024 +0800

    Remove the use of jbossts-properties.xml in nativeTest via Narayana Java 
API (#30102)
---
 .../natived/jdbc/transactions/xa/NarayanaTest.java |  5 ++-
 .../resource-config.json                           |  3 --
 .../src/test/resources/jbossts-properties.xml      | 47 ----------------------
 3 files changed, 4 insertions(+), 51 deletions(-)

diff --git 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/xa/NarayanaTest.java
 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/xa/NarayanaTest.java
index 5b7a76f3e15..48073f62fcc 100644
--- 
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/xa/NarayanaTest.java
+++ 
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/transactions/xa/NarayanaTest.java
@@ -17,6 +17,8 @@
 
 package org.apache.shardingsphere.test.natived.jdbc.transactions.xa;
 
+import com.arjuna.ats.arjuna.common.CoreEnvironmentBeanException;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
 import com.zaxxer.hikari.HikariConfig;
 import com.zaxxer.hikari.HikariDataSource;
 import org.apache.shardingsphere.test.natived.jdbc.commons.TestShardingService;
@@ -30,7 +32,8 @@ class NarayanaTest {
     private TestShardingService testShardingService;
     
     @Test
-    void assertShardingInNarayanaTransactions() throws SQLException {
+    void assertShardingInNarayanaTransactions() throws SQLException, 
CoreEnvironmentBeanException {
+        arjPropertyManager.getCoreEnvironmentBean().setNodeIdentifier("1");
         HikariConfig config = new HikariConfig();
         
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
         
config.setJdbcUrl("jdbc:shardingsphere:classpath:test-native/yaml/transactions/xa/narayana.yaml");
diff --git 
a/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
 
b/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
index d50b3c3a86b..eb118f6ef69 100644
--- 
a/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
+++ 
b/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/resource-config.json
@@ -45,9 +45,6 @@
   }, {
     
"condition":{"typeReachable":"org.apache.shardingsphere.test.natived.jdbc.transactions.xa.NarayanaTest"},
     "pattern":"\\Qtest-native/yaml/transactions/xa/narayana.yaml\\E"
-  }, {
-    
"condition":{"typeReachable":"com.arjuna.common.util.propertyservice.FileLocator"},
-    "pattern":"\\Qjbossts-properties.xml\\E"
   }]},
   "bundles":[]
 }
diff --git a/test/native/src/test/resources/jbossts-properties.xml 
b/test/native/src/test/resources/jbossts-properties.xml
deleted file mode 100644
index 75719774f3a..00000000000
--- a/test/native/src/test/resources/jbossts-properties.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd";>
-<!--suppress CheckTagEmptyBody -->
-<properties>
-    <entry key="CoordinatorEnvironmentBean.commitOnePhase">YES</entry>
-    <entry key="ObjectStoreEnvironmentBean.objectStoreDir">target</entry>
-    <entry 
key="com.arjuna.ats.arjuna.objectstore.objectStoreDir">target</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>

Reply via email to