* checks that after calling it {@link IExpiring#hasBeenActive()} returns
* true.
*/
public void testHasBeenActive() {
IExpiring testObject = getTestObject();
Method[] methods = getInterface().getMethods();
// after two times calling this method has to return false
testObject.hasBeenActive();
assertFalse(testObject.hasBeenActive());
// after activated(), hasBeenActive has to return true
testObject.activated();
assertTrue(testObject.hasBeenActive());
for (Method m : methods) {
try {
testObject = getTestObject();
testObject.hasBeenActive(); // let's make sure the method will return
// false next time if we don't do anything
Class<?>[] paramTypes = m.getParameterTypes();
Object[] params = new Object[paramTypes.length];
m.invoke(testObject, params);
} catch (IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
fail();
} catch (InvocationTargetException e) {
// there'll probably a big fuss going on inside the method but we'll
// ignore it
}
boolean b = testObject.hasBeenActive();
if (!b) {
System.out.println(m.getName() + " is not resetting #hasBeenActive()!");
}
}
}