This is an automated email from the ASF dual-hosted git repository. dsoumis pushed a commit to branch 11.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 5d3ce35cdb14905b914907b22f2e0bcfa19b7985 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 618a60221d..fadb39e801 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]
