import java.util.Map;
import java.util.Set;
-
/**
* Useful assertions for use in test cases.
- *
+ *
* @author Erik Brakkee
*/
public final class AssertionUtils {
/**
* Disabled constructor.
- *
+ *
*/
private AssertionUtils() {
// Empty
/**
* Asserts that two object arrays are equal.
- *
+ *
* @param aExpected
* Expected object array.
* @param aActual
/**
* Asserts that two object arrays are equal.
- *
+ *
* @param aMsg
* Message.
* @param aExpected
}
}
- /**
+/**
* Asserts that two objects are equal, and in case the object is an Object[]
* delegates to {@link #assertEquals(String, Object[], Object[]).
*
/**
* Asserts that two maps are equal by comparing all keys and by checking
* that the values for the same keys are the same.
- *
+ *
* @param aMsg
* Message.
* @param aExpectedMap
*/
public static <Key, Value> void assertEquals(String aMsg,
Map<Key, Value> aExpectedMap, Map<Key, Value> aActual) {
- TestCase.assertEquals("Map sizes differ", aExpectedMap.size(),
- aActual.size());
+ TestCase.assertEquals("Map sizes differ", aExpectedMap.size(), aActual
+ .size());
Set keys = aExpectedMap.keySet();
/**
* Asserts that an exception occurs.
- * @param aRunnable Test cases should create a subclass of this which contains the
- * code that should throw an exception.
- * @param aType Type of exception that is expected.
+ *
+ * @param aRunnable
+ * Test cases should create a subclass of this which contains the
+ * code that should throw an exception.
+ * @param aType
+ * Type of exception that is expected.
*/
public static void assertException(ErroneousCode aObject, Class aType) {
try {
if (aType.isInstance(t)) {
LOG.info("Expected exception occured " + t.getMessage());
- return; // ok
+ return; // ok
} else {
throw new RuntimeException(t);
}