RFR[8217825]: Verify @AfterTest is used correctly in WebSocket tests

Daniel Fuchs daniel.fuchs at oracle.com
Fri Sep 13 14:47:43 UTC 2019


Hi Patrick,

I wonder if you should be using `try { } finally { }` to ensure
that the websocket is closed too:

    var websocket = .....;
    try {
	// send some messages etc...
    } finally {
	websocket.abort();
    }

best regards,

-- daniel

On 13/09/2019 15:36, Patrick Concannon wrote:
> Hi, 


> 
> 
> Would it be possible to have my fix for JDK-8217825 - Verify @AfterTest 
> is used correctly in WebSocket tests - reviewed?
> 
> Following on from the discussion had here: 
> https://mail.openjdk.java.net/pipermail/net-dev/2019-January/012141.html, I’ve 
> refactored several websocket tests to explicitly close resources opened 
> during each test method i.e. test servers and websockets.
> 
> Tests refactored:
> - test/jdk/java/net/httpclient/websocket/AutomaticPong.java
> - test/jdk/java/net/httpclient/websocket/WebsocketTest.java
> - test/jdk/java/net/httpclient/websocket/SendTest.java
> - test/jdk/java/net/httpclient/websocket/Abort.java
> 
> 
> Further information on this bug can be found here: 
> https://bugs.openjdk.java.net/browse/JDK-8217825
> 
> 

Webrev for fix: 
> http://cr.openjdk.java.net/~pconcannon/8217825/webrevs/webrev.00/
> 
> 
> 

Kind regards,

> 
> Patrick
> 



More information about the net-dev mailing list