RFR[8217825]: Verify @AfterTest is used correctly in WebSocket tests
Patrick Concannon
patrick.concannon at oracle.com
Fri Sep 20 10:27:08 UTC 2019
Hi Daniel,
Thanks for the feedback. That's a good idea. I've made those changes and
I've included them in the webrev below.
http://cr.openjdk.java.net/~pconcannon/8217825/webrevs/webrev.01/
Kind regards,
Patrick
On 13/09/2019 15:47, Daniel Fuchs wrote:
> 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