@Deprecated public static boolean equals( Object firstArray, Object otherArray ) { return equals( firstArray, otherArray, DEFAULT_ARRAY_EQUALITY ); }
@Override public boolean equals( Object obj ) { return obj instanceof ArrayEqualityObject && ArrayUtil.equals( array, ((ArrayEqualityObject) obj).array ); }
@Override public boolean equals( Object obj ) { return obj instanceof ArrayEqualityObject && ArrayUtil.equals( array, ((ArrayEqualityObject) obj).array ); }
public static void assertObjectOrArrayEquals( String message, Object expected, Object actual ) { if ( expected.getClass().isArray() ) { if ( !ArrayUtil.equals( expected, actual ) ) { throw newAssertionError( message, expected, actual ); } } else { if ( !Objects.equals( expected, actual ) ) { throw newAssertionError( message, expected, actual ); } } }
private void shouldNotBeAbleToPoisonArrayPropertyInsideTransaction( Object value, Object poison ) { // GIVEN String key = "key"; // setting a property, then reading it back node1.setProperty( key, value ); Object readValue = node1.getProperty( key ); // WHEN changing the value read back Array.set( readValue, 0, poison ); // THEN reading the value one more time should still yield the set property assertTrue( format( "Expected %s, but was %s", Strings.prettyPrint( value ), Strings.prettyPrint( readValue ) ), ArrayUtil.equals( value, node1.getProperty( key ) ) ); }
private void shouldNotBeAbleToPoisonArrayPropertyOutsideTransaction( Object value, Object poison ) { // GIVEN String key = "key"; // setting a property, then reading it back node1.setProperty( key, value ); newTransaction(); Object readValue = node1.getProperty( key ); // WHEN changing the value read back Array.set( readValue, 0, poison ); // THEN reading the value one more time should still yield the set property assertTrue( format( "Expected %s, but was %s", Strings.prettyPrint( value ), Strings.prettyPrint( readValue ) ), ArrayUtil.equals( value, node1.getProperty( key ) ) ); } }
@Deprecated public static boolean equals( Object firstArray, Object otherArray ) { return equals( firstArray, otherArray, DEFAULT_ARRAY_EQUALITY ); }