This is an automated email from the ASF dual-hosted git repository. dsoumis pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit d87d24d76045bfb80ba92e2ba4c5a06df376403c Author: Dimitris Soumis <[email protected]> AuthorDate: Wed Apr 1 13:10:01 2026 +0300 Add testCustomCloseCode() in TestClose --- test/org/apache/tomcat/websocket/server/TestClose.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/org/apache/tomcat/websocket/server/TestClose.java b/test/org/apache/tomcat/websocket/server/TestClose.java index 052af7e9f7..8980ca8778 100644 --- a/test/org/apache/tomcat/websocket/server/TestClose.java +++ b/test/org/apache/tomcat/websocket/server/TestClose.java @@ -186,6 +186,19 @@ public class TestClose extends WebSocketBaseTest { awaitOnClose(CloseCodes.CLOSED_ABNORMALLY); } + @Test + public void testCustomCloseCode() throws Exception { + startServer(TestEndpointConfig.class); + + TesterWsClient client = new TesterWsClient("localhost", getPort()); + client.httpUpgrade(BaseEndpointConfig.PATH); + client.sendCloseFrame(CloseCodes.getCloseCode(3500)); + client.closeSocket(); + + awaitLatch(events.onCloseCalled, "onClose not called"); + Assert.assertEquals(3500, events.closeReason.getCloseCode().getCode()); + } + @Test public void testTcpResetInOnMessage() throws Exception { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
