diff --git a/dev/com.ibm.ws.transaction.fat.util/src/com/ibm/ws/wsat/fat/util/WSATTest.java b/dev/com.ibm.ws.transaction.fat.util/src/com/ibm/ws/wsat/fat/util/WSATTest.java index 2329d320ba24..e0700d7f8d28 100644 --- a/dev/com.ibm.ws.transaction.fat.util/src/com/ibm/ws/wsat/fat/util/WSATTest.java +++ b/dev/com.ibm.ws.transaction.fat.util/src/com/ibm/ws/wsat/fat/util/WSATTest.java @@ -23,6 +23,7 @@ import org.junit.Rule; import org.junit.rules.TestName; +import com.ibm.tx.jta.ut.util.XAResourceImpl; import com.ibm.websphere.simplicity.log.Log; import componenttest.topology.impl.LibertyServer; @@ -77,6 +78,14 @@ private static URI appendUri(URI oldUri, String appendQuery) throws URISyntaxExc return newUri; } + public static void deleteStateFiles(LibertyServer... servers) throws Exception { + final String stateFile = XAResourceImpl.getStateFile().getName(); + Log.info(WSATTest.class, "deleteStateFiles", stateFile); + for (LibertyServer server : servers) { + server.deleteFileFromLibertyServerRoot(stateFile); + } + } + public static void callClearResourcesServlet(String app, LibertyServer... servers) throws Exception{ final String method = "callClearResourcesServlet"; int expectedConnectionCode = HttpURLConnection.HTTP_OK; diff --git a/dev/com.ibm.ws.transaction.test.util/src/com/ibm/tx/jta/ut/util/XAResourceImpl.java b/dev/com.ibm.ws.transaction.test.util/src/com/ibm/tx/jta/ut/util/XAResourceImpl.java index a82ab2aa30c7..7cc2ba4b381d 100644 --- a/dev/com.ibm.ws.transaction.test.util/src/com/ibm/tx/jta/ut/util/XAResourceImpl.java +++ b/dev/com.ibm.ws.transaction.test.util/src/com/ibm/tx/jta/ut/util/XAResourceImpl.java @@ -1632,4 +1632,8 @@ public static synchronized void loadState(File stateFile) { setStateFile(stateFile); loadState(); } + + public static File getStateFile() { + return STATE_FILE; + } } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.lps/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.lps/build.gradle index c0ec0cc14bbb..fb04feec7d5a 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.lps/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.lps/build.gradle @@ -10,11 +10,15 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - -dependencies { - requiredLibs (project(":com.ibm.ws.transaction.fat.util")) { +configurations { + requiredLibs { transitive = false } } +dependencies { + requiredLibs project(":com.ibm.ws.transaction.test.util"), + project(":com.ibm.ws.transaction.fat.util") +} + addRequiredLibraries.dependsOn addJakartaTransformer diff --git a/dev/com.ibm.ws.wsat.recovery_fat.lps/fat/src/tests/LPSTest.java b/dev/com.ibm.ws.wsat.recovery_fat.lps/fat/src/tests/LPSTest.java index 9eb8a5fa4102..6003f14aff47 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.lps/fat/src/tests/LPSTest.java +++ b/dev/com.ibm.ws.wsat.recovery_fat.lps/fat/src/tests/LPSTest.java @@ -72,8 +72,8 @@ public static void beforeTests() throws Exception { @Before public void beforeTest() throws Exception { + WSATTest.deleteStateFiles(server1, server2); FATUtils.startServers(server1, server2); - WSATTest.callClearResourcesServlet("recoveryServer", server1, server2); } @After diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.1/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.1/build.gradle index 26777f020d2f..50f97e573814 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.1/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.1/build.gradle @@ -10,7 +10,6 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false @@ -20,6 +19,7 @@ configurations { // Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.1/fat/src/tests/MultiRecoveryTest.java b/dev/com.ibm.ws.wsat.recovery_fat.multi.1/fat/src/tests/MultiRecoveryTest.java index b7d12a2914c1..97158e09ed83 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.1/fat/src/tests/MultiRecoveryTest.java +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.1/fat/src/tests/MultiRecoveryTest.java @@ -88,13 +88,11 @@ public void run(LibertyServer s) throws Exception { ShrinkHelper.exportDropinAppToServer(server1, serverApp); ShrinkHelper.exportDropinAppToServer(server2, serverApp); } - - @Before + + @Before public void before() throws Exception { - Log.info(MultiRecoveryTest.class, "before", ""); + WSATTest.deleteStateFiles(server1, server2); FATUtils.startServers(runner, server1, server2); - - WSATTest.callClearResourcesServlet(recoveryServer, server1, server2); } @After diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.2/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.2/build.gradle index f56494d0ec5c..ea9fd8888c8e 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.2/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.2/build.gradle @@ -10,17 +10,16 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false } } -// Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), project(":com.ibm.ws.wsat.recovery_fat.multi.1"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.3/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.3/build.gradle index f56494d0ec5c..ea9fd8888c8e 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.3/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.3/build.gradle @@ -10,17 +10,16 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false } } -// Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), project(":com.ibm.ws.wsat.recovery_fat.multi.1"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.4/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.4/build.gradle index f56494d0ec5c..ea9fd8888c8e 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.4/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.4/build.gradle @@ -10,17 +10,16 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false } } -// Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), project(":com.ibm.ws.wsat.recovery_fat.multi.1"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.5/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.5/build.gradle index f56494d0ec5c..ea9fd8888c8e 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.5/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.5/build.gradle @@ -10,17 +10,16 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false } } -// Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), project(":com.ibm.ws.wsat.recovery_fat.multi.1"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.6/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.6/build.gradle index f56494d0ec5c..ea9fd8888c8e 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.6/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.6/build.gradle @@ -10,17 +10,16 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false } } -// Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), project(":com.ibm.ws.wsat.recovery_fat.multi.1"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.7/build.gradle b/dev/com.ibm.ws.wsat.recovery_fat.multi.7/build.gradle index b3947b469468..474d0d3cfb9c 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.7/build.gradle +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.7/build.gradle @@ -10,17 +10,16 @@ * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ - configurations { requiredLibs { transitive = false } } -// Define G:A:V coordinates of each dependency dependencies { requiredLibs project(":com.ibm.ws.wsat.recovery_fat.lps"), project(":com.ibm.ws.wsat.recovery_fat.multi.1"), + project(":com.ibm.ws.transaction.test.util"), project(":com.ibm.ws.transaction.fat.util") } diff --git a/dev/com.ibm.ws.wsat.recovery_fat.multi.7/publish/servers/WSATRecoveryServer1/server.xml b/dev/com.ibm.ws.wsat.recovery_fat.multi.7/publish/servers/WSATRecoveryServer1/server.xml index ae90fe746d63..5e89de59e3ad 100644 --- a/dev/com.ibm.ws.wsat.recovery_fat.multi.7/publish/servers/WSATRecoveryServer1/server.xml +++ b/dev/com.ibm.ws.wsat.recovery_fat.multi.7/publish/servers/WSATRecoveryServer1/server.xml @@ -22,7 +22,7 @@