Fix broken test cases
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
fdd27a9f28
commit
8638fb2cc3
|
@ -180,8 +180,9 @@ public class JavaxOnCloseTest
|
|||
assertTrue(serverEndpoint.openLatch.await(5, TimeUnit.SECONDS));
|
||||
serverEndpoint.setOnClose((session) ->
|
||||
{
|
||||
assertThrows(ClosedChannelException.class,
|
||||
IOException error = assertThrows(IOException.class,
|
||||
() -> session.close(new CloseReason(CloseCodes.UNEXPECTED_CONDITION, "abnormal close 2")));
|
||||
assertThat(error.getCause(), instanceOf(ClosedChannelException.class));
|
||||
clientEndpoint.unBlockClose();
|
||||
});
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package org.eclipse.jetty.websocket.tests;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.channels.ClosedChannelException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -38,6 +39,7 @@ import org.junit.jupiter.api.BeforeEach;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.instanceOf;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
@ -126,7 +128,8 @@ public class WebSocketStopTest
|
|||
assertThat(clientSocket.statusCode, is(StatusCode.NORMAL));
|
||||
assertThat(serverSocket.statusCode, is(StatusCode.NORMAL));
|
||||
|
||||
assertThrows(ClosedChannelException.class,
|
||||
IOException error = assertThrows(IOException.class,
|
||||
() -> session.getRemote().sendString("this should fail before ExtensionStack"));
|
||||
assertThat(error.getCause(), instanceOf(ClosedChannelException.class));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue