Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ClearResourcesServlet #30284

Open
wants to merge 1 commit into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,4 @@ public static void deleteStateFiles(LibertyServer... servers) throws Exception {
server.deleteFileFromLibertyServerRoot(stateFile);
}
}

public static void callClearResourcesServlet(String app, LibertyServer... servers) throws Exception{
final String method = "callClearResourcesServlet";
int expectedConnectionCode = HttpURLConnection.HTTP_OK;
String servletName = "ClearResourcesServlet";

for (LibertyServer server : servers) {
String urlStr = "http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/" + app + "/" + servletName;

Log.info(WSATTest.class, method, "callClearResourcesServlet URL: " + urlStr);
HttpURLConnection con = HttpUtils.getHttpConnection(new URL(urlStr),
expectedConnectionCode, REQUEST_TIMEOUT);
try {
HttpUtils.getConnectionStream(con).readLine();
} finally {
con.disconnect();
}

server.setMarkToEndOfLog();
server.setTraceMarkToEndOfDefaultTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2023 IBM Corporation and others.
* Copyright (c) 2020, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand All @@ -25,6 +25,7 @@
import javax.xml.ws.BindingProvider;

import com.ibm.tx.jta.ut.util.TxTestUtils;
import com.ibm.tx.jta.ut.util.XAResourceImpl;

@WebServlet({ "/RecoverySetupServlet" })
public class RecoverySetupServlet extends HttpServlet {
Expand All @@ -37,10 +38,13 @@ public class RecoverySetupServlet extends HttpServlet {

protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
TxTestUtils.setTestResourcesFile();
int number = Integer.parseInt(request.getParameter("number").trim());
System.out.println("==============RecoverySetupServlet Test Number: " + number
+ "================");

TxTestUtils.setTestResourcesFile();
XAResourceImpl.clear();

String BASE_URL = request.getParameter("baseurl");
if (BASE_URL == null || BASE_URL.equals("")){
BASE_URL = "http://localhost:"+Integer.parseInt(System.getProperty("HTTP_secondary"));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public void after() throws Exception {
@Before
public void before() throws Exception {
Log.info(ReroutePeerRecoveryTest.class, "before", "");
WSATTest.deleteStateFiles(server3, server5);
FATUtils.startServers(runner, server1, server2, server3, server4, server5, server6);
WSATTest.callClearResourcesServlet(recoveryServer, server3, server5);
server3.setTraceMarkToEndOfDefaultTrace();
server5.setTraceMarkToEndOfDefaultTrace();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2022, 2023 IBM Corporation and others.
* Copyright (c) 2022, 2024 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -58,21 +58,13 @@ public static void beforeTests() throws Exception {

FATUtils.startServers(server1);
}

@Before
public void before() throws Exception {
WSATTest.callClearResourcesServlet("recoveryServer", server1);
}

@AfterClass
public static void tearDown() throws Exception {
FATUtils.stopServers((String[])null, server1);
}

protected void recoveryTest(String id) throws Exception {
// Log.info(this.getClass(), "recoveryTest", "We are in "+new File(".").getCanonicalPath());
// Log.info(this.getClass(), "recoveryTest", "Printing "+new File("../../").getCanonicalPath());
// Log.info(this.getClass(), "recoveryTest", printDirectoryTree(new File("../../")));
final String method = "recoveryTest";
String result = null;
String logKeyword = "Jordan said in test: ";
Expand Down