nizhikov commented on code in PR #10047:
URL: https://github.com/apache/ignite/pull/10047#discussion_r893231897
##########
modules/core/src/test/java/org/apache/ignite/testframework/junits/JUnitAssertAware.java:
##########
@@ -203,4 +203,33 @@ protected static void assertNotSame(Object unexpected,
Object actual) {
protected static void assertNotSame(String msg, Object exp, Object actual)
{
Assert.assertNotSame(msg, exp, actual);
}
+
+ /** Check arrays equality as well as objects equality. */
+ protected static void assertEqualsArraysOrObjects(Object exp, Object
actual) {
+ assertEqualsArraysOrObjects(null, exp, actual);
+ }
+
+ /** Check arrays equality as well as objects equality. */
+ protected static void assertEqualsArraysOrObjects(String msg, Object exp,
Object actual) {
+ if (exp instanceof Object[] && actual instanceof Object[])
+ Assert.assertArrayEquals(msg, (Object[])exp, (Object[])actual);
+ else if (exp instanceof byte[] && actual instanceof byte[])
Review Comment:
This can be shortened to `exp != null && exp.getClass().isArray() &&
exp.getClass().getElementClass().isPrimitive()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]