package org.wamblee.test;
import java.util.Arrays;
-import java.util.Comparator;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* Useful assertions for use in test cases.
*
* @author Erik Brakkee
*/
public final class AssertionUtils {
+
+ private static final Log LOG = LogFactory.getLog(AssertionUtils.class);
/**
* Disabled constructor.
*/
public static <T> void assertEquals(String aMsg, T[] aExpected,
T[] aActual) {
- TestCase.assertEquals(aMsg + ": Array lengths ", aExpected.length,
+ TestCase.assertEquals(aMsg + " expected " +
+ Arrays.asList(aExpected) + ", actual " +
+ Arrays.asList(aActual) + ": Array lengths ", aExpected.length,
aActual.length);
for (int i = 0; i < aExpected.length; i++) {
throw new RuntimeException("No exception occurred");
} catch (Throwable t) {
if ( aType.isInstance(t)) {
+ LOG.info("Expected exception occured " + t.getMessage());
return; // ok
}
else {