Skip to content

Commit 11cd8f3

Browse files
committed
Use new option to configure client endpoint using an annotated class
Improves TCK coverage as `WebSocketContainer.connectToServer(Class<?>, URI)` was not previously tested.
1 parent 780ab88 commit 11cd8f3

File tree

1 file changed

+3
-6
lines changed
  • tck/spec-tests/src/main/java/com/sun/ts/tests/websocket/ee/jakarta/websocket/clientendpoint

1 file changed

+3
-6
lines changed

tck/spec-tests/src/main/java/com/sun/ts/tests/websocket/ee/jakarta/websocket/clientendpoint/WSClientIT.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ public WSClientIT() throws Exception {
6767
*/
6868
@Test
6969
public void subprotocolsMatchTest() throws Exception {
70-
WSCMatchedSubprotocolClientEndpoint endpoint = new WSCMatchedSubprotocolClientEndpoint();
71-
setAnnotatedClientEndpointInstance(endpoint);
70+
setAnnotatedClientEndpoint(WSCMatchedSubprotocolClientEndpoint.class);
7271
invoke("subprotocol", OPS.NEGOTIATED, StringUtil.WEBSOCKET_SUBPROTOCOLS_1);
7372
}
7473

@@ -82,8 +81,7 @@ public void subprotocolsMatchTest() throws Exception {
8281
*/
8382
@Test
8483
public void subprotocolsNotMatchTest() throws Exception {
85-
WSCUnmatchedSubprotocolClientEndpoint endpoint = new WSCUnmatchedSubprotocolClientEndpoint();
86-
setAnnotatedClientEndpointInstance(endpoint);
84+
setAnnotatedClientEndpoint(WSCUnmatchedSubprotocolClientEndpoint.class);
8785
invoke("subprotocol", OPS.NEGOTIATED, "{}");
8886
}
8987

@@ -101,8 +99,7 @@ public void subprotocolsNotMatchTest() throws Exception {
10199
*/
102100
@Test
103101
public void configuratorTest() throws Exception {
104-
WSCConfiguratedClientEndpoint endpoint = new WSCConfiguratedClientEndpoint();
105-
setAnnotatedClientEndpointInstance(endpoint);
102+
setAnnotatedClientEndpoint(WSCConfiguratedClientEndpoint.class);
106103
invoke("echo", OPS.ECHO_MSG, OPS.ECHO_MSG);
107104
ClientConfigurator configurator = ClientConfiguratorHolderClientConfigurator.getConfigurator();
108105
configurator.assertBeforeRequestHasBeenCalled();

0 commit comments

Comments
 (0)