Skip to content

Commit

Permalink
WFLY-18733 Deployments of SharedClientContextTestCase should be undep…
Browse files Browse the repository at this point in the history
…loyed
  • Loading branch information
OndrejKotek committed Nov 10, 2023
1 parent 029d697 commit 91cec3c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class SharedClientContextTestCase extends AbstractCliTestBase {

private static final String EJB = "shared-client-context-ejb";
private static final String FRONTEND = "shared-client-context-frontend";
private static final String CLIENT_NAME_BASE = "shared-client-context-client-%02d";
private static final int CLIENTS_NUMBER = 50;
private static List<File> clientWarFiles = new ArrayList<>();

Expand Down Expand Up @@ -76,7 +77,7 @@ public static WebArchive deployment3() {
public static void beforeClass() throws Exception {
File clientWarFile = null;
for (int i = 0; i < CLIENTS_NUMBER; i++){
String clientWarFileName = String.format("shared-client-context-client-%02d", i);
String clientWarFileName = String.format(CLIENT_NAME_BASE, i);
clientWarFile = exportClientWar(clientWarFileName + ".war");
clientWarFiles.add(clientWarFile);
}
Expand All @@ -97,15 +98,16 @@ private static File exportClientWar(String name) {
@Before
public void before() throws MalformedURLException {
for (int i = 0; i < clientWarFiles.size(); i++) {
String clientWarFileName = String.format("shared-client-context-client-%02d", i);
String clientWarFileName = String.format(CLIENT_NAME_BASE, i);
cli.sendLine("deploy --url=" + clientWarFiles.get(i).toURI().toURL().toExternalForm() + " --name=" + clientWarFileName + ".war --runtime-name=" + clientWarFileName + ".war");
}
}

@AfterClass
public static void closeCli() throws Exception {
for (int i = 0; i < clientWarFiles.size(); i++) {
clientWarFiles.get(i).delete();
String clientWarFileName = String.format(CLIENT_NAME_BASE, i);
cli.sendLine("undeploy --name=" + clientWarFileName + ".war");
}

AbstractCliTestBase.closeCLI();
Expand Down

0 comments on commit 91cec3c

Please sign in to comment.