Skip to content

Commit

Permalink
EJBCLIENT-502 Fix the use of deprecated methods in org.wildfly.transa…
Browse files Browse the repository at this point in the history
…ction.client.provider.jboss.JBossLocalTransactionProvider.Builder (#631)
  • Loading branch information
chengfang authored Jun 7, 2023
1 parent de0d2d5 commit b079860
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
*/
package org.jboss.ejb.client.test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

import jakarta.ejb.NoSuchEJBException;
import org.jboss.ejb.client.ClusterAffinity;
import org.jboss.ejb.client.ClusterNodeSelector;
import org.jboss.ejb.client.EJBClient;
Expand All @@ -37,17 +48,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

import jakarta.ejb.NoSuchEJBException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
* Tests the ability of the the RemoteEJBDiscoveryProvider to detect the condition when a last node left in a cluster has crashed
* and to remove that cluster from the discovered node registry (DNR).
Expand Down Expand Up @@ -127,12 +127,12 @@ public void beforeTest() throws Exception {
}

/*
* Returns a list of true/fase values describing current server availability.
* Returns a list of true/false values describing current server availability.
*/
public static List<Boolean> getServersStarted() {
List<Boolean> booleanList = new ArrayList<Boolean>();
for (int i = 0; i < serversStarted.length; i++) {
booleanList.add(new Boolean(serversStarted[i]));
booleanList.add(serversStarted[i]);
}
return booleanList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.arjuna.ats.jta.common.jtaPropertyManager;
import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
import jakarta.transaction.TransactionManager;
import jakarta.transaction.TransactionSynchronizationRegistry;
import jakarta.transaction.UserTransaction;
import org.jboss.ejb.client.test.common.Echo;
import org.jboss.ejb.client.test.common.StatefulEchoBean;
Expand Down Expand Up @@ -84,12 +83,10 @@ public static void beforeClass() throws Exception {
jtaEnvironmentBean.setTransactionManagerClassName(TransactionManagerImple.class.getName());
jtaEnvironmentBean.setTransactionSynchronizationRegistryClassName(TransactionSynchronizationRegistryImple.class.getName());
final TransactionManager narayanaTm = jtaEnvironmentBean.getTransactionManager();
final TransactionSynchronizationRegistry narayanaTsr = jtaEnvironmentBean.getTransactionSynchronizationRegistry();
final XATerminator xat = new XATerminator();
final JBossLocalTransactionProvider.Builder builder = JBossLocalTransactionProvider.builder();
builder.setXATerminator(xat).setExtendedJBossXATerminator(xat);
builder.setExtendedJBossXATerminator(xat);
builder.setTransactionManager(narayanaTm);
builder.setTransactionSynchronizationRegistry(narayanaTsr);
builder.setXAResourceRecoveryRegistry(new XAResourceRecoveryRegistry() {
@Override
public void addXAResourceRecovery(XAResourceRecovery xaResourceRecovery) {
Expand Down

0 comments on commit b079860

Please # to comment.