public static void arrays(Object[] actual, Object... expected) {
for(int i = 0; i < Math.min(actual.length, expected.length); ++i)
Assert.assertEquals("Array mismatch at index " + i + ":", expected[i],
actual[i]);
Assert.assertEquals("Array length mismatch", expected.length,
actual.length);
}
How JUnit's assertArrayEquals() should be implemented
Subscribe to:
Post Comments (Atom)
Take a look at hamcrest. It has a multiple built-in matchers.
milus
April 19, 2010 at 9:07 PMThanks for posting this blog. This was very interesting blog, I felt comfortable while reading this post, thank you..........................To knowOracle Training
Sandeep SEO
January 27, 2018 at 9:38 AM