From d5cd05eb0d8d6f0c34482f3a0439223501a4e590 Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Wed, 30 Jan 2019 23:02:00 +0000 Subject: [PATCH] Fix #35 failing basic batchingAllowed* tests Flush after enabling batching so client receives message. Ensure batching configuration is restored to default so subsequent messages are not batched on the server causing the client to time out waiting for them and the test to fail. Signed-off-by: Mark Thomas --- .../remoteendpoint/basic/WSCServerSideServer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/sun/ts/tests/websocket/ee/javax/websocket/remoteendpoint/basic/WSCServerSideServer.java b/src/com/sun/ts/tests/websocket/ee/javax/websocket/remoteendpoint/basic/WSCServerSideServer.java index e4de4438a9..e55a853d3e 100644 --- a/src/com/sun/ts/tests/websocket/ee/javax/websocket/remoteendpoint/basic/WSCServerSideServer.java +++ b/src/com/sun/ts/tests/websocket/ee/javax/websocket/remoteendpoint/basic/WSCServerSideServer.java @@ -150,7 +150,7 @@ public void onError(Session session, Throwable t) throws IOException { * Again, since the asynchronous thread sends message in virtually no time, * one does not have any force to hold that send operation in its thread, to * check the send operation is really unblocking and asynchronous - * + * * @param asyncRemote * @return */ @@ -327,6 +327,11 @@ protected static String batchingAllowed(Basic basicRemote) { // really there is nothing to test, except that the exception is // not thrown basicRemote.sendText(OPS.BATCHING_ALLOWED.name()); + basicRemote.flushBatch(); + // If batching is supported then it will currently be enabled. + // Reset it so subsequent messages are not batched causing the + // test to fail. + basicRemote.setBatchingAllowed(allowed); return RESPONSE[0]; } catch (Exception e) { e.printStackTrace();