RFR: 8266250: WebSocketTest and WebSocketProxyTest call assertEquals(List<byte[]>, List<byte[]>)

Daniel Fuchs daniel.fuchs at oracle.com
Thu Apr 29 09:01:23 UTC 2021


On 28/04/2021 23:51, Pavel Rappo wrote:
> On Wed, 28 Apr 2021 21:22:23 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
> 
>> It also avoids relying on an unspecified behavior of `Assert.assertEquals`.
> 
> Which behavior is that? If I recall correctly, the test was written for TestNG 6.9.5, which provides a [method to compare collections](https://github.com/cbeust/testng/blob/ef2d1199abff4e1b8fa4b1148c1314e776d7a044/src/main/java/org/testng/Assert.java#L508-L517).

Exactly - that API specification doesn't say whether elements
that are arrays will be compared using shallow equals or deep
equals.

The latest version of TestNG seems to have changed how elements
in collections are compared:
https://github.com/cbeust/testng/blob/b60a1a13d274e5991f357d3ad1b41ce16c53de64/core/src/main/java/org/testng/Assert.java#L143

-- daniel


> 
> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/3776
> 



More information about the net-dev mailing list