Skip to content

Commit

Permalink
Rename prior to extending with additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Feb 13, 2024
1 parent 3a9dbd1 commit 2070b43
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/org/apache/tomcat/websocket/TestWsSessionSuspendResume.java
Expand Up @@ -44,11 +44,11 @@
public class TestWsSessionSuspendResume extends WebSocketBaseTest {

@Test
public void test() throws Exception {
public void testSuspendResume() throws Exception {
Tomcat tomcat = getTomcatInstance();

Context ctx = getProgrammaticRootContext();
ctx.addApplicationListener(Config.class.getName());
ctx.addApplicationListener(SuspendResumeConfig.class.getName());

Tomcat.addServlet(ctx, "default", new DefaultServlet());
ctx.addServletMappingDecoded("/", "default");
Expand All @@ -59,7 +59,7 @@ public void test() throws Exception {

ClientEndpointConfig clientEndpointConfig = ClientEndpointConfig.Builder.create().build();
Session wsSession = wsContainer.connectToServer(TesterProgrammaticEndpoint.class, clientEndpointConfig,
new URI("ws://localhost:" + getPort() + Config.PATH));
new URI("ws://localhost:" + getPort() + SuspendResumeConfig.PATH));

CountDownLatch latch = new CountDownLatch(2);
wsSession.addMessageHandler(String.class, message -> {
Expand All @@ -77,7 +77,7 @@ public void test() throws Exception {
}


public static final class Config extends TesterEndpointConfig {
public static final class SuspendResumeConfig extends TesterEndpointConfig {
private static final String PATH = "/echo";

@Override
Expand All @@ -96,7 +96,7 @@ public static final class SuspendResumeEndpoint extends Endpoint {

@Override
public void onOpen(Session session, EndpointConfig epc) {
MessageProcessor processor = new MessageProcessor(session, 3);
SuspendResumeMessageProcessor processor = new SuspendResumeMessageProcessor(session, 3);
session.addMessageHandler(String.class, message -> processor.addMessage(message));
}

Expand All @@ -116,12 +116,12 @@ public void onError(Session session, Throwable t) {
}


private static final class MessageProcessor {
private static final class SuspendResumeMessageProcessor {
private final Session session;
private final int count;
private final List<String> messages = new ArrayList<>();

MessageProcessor(Session session, int count) {
SuspendResumeMessageProcessor(Session session, int count) {
this.session = session;
this.count = count;
}
Expand Down

0 comments on commit 2070b43

Please sign in to comment.