eachRunNotifier.fireTestStarted();
LOG.debug("Calling method {} with values {}", method.getName(), values);
returnObj = method.invokeExplosively(freshInstance, values);
eachRunNotifier.fireTestFinished();
TestMethodDuration testItemDurationBean = new TestMethodDuration(currentMethodName,
testRunDurationListener.getStartInNano(), testRunDurationListener.getEndInNano());
testResult.addTestItemDurationBean(testItemDurationBean);
testResult.setOutput((returnObj == null) ? "void" : returnObj);
testResult.setPassed(Boolean.TRUE);
if (writableRow != null) {
if (returnObj != null) {
LOG.debug("Data returned by method {} is {} :", method.getName(), returnObj);
writableRow.put(Loader.ACTUAL_RESULT, returnObj);
Object expectedResult = writableRow.get(Loader.EXPECTED_RESULT);
// if expected result exist in user input test data,
// then compare that with actual output result
// and write the status back to writable map data.
if (expectedResult != null) {
LOG.debug("Expected result exists");
if (expectedResult.toString().equals(returnObj.toString())) {
writableRow.put(Loader.TEST_STATUS, Loader.TEST_PASSED);
} else {
writableRow.put(Loader.TEST_STATUS, Loader.TEST_FAILED);
}
}
}
LOG.debug("testItemDurationBean:" + testItemDurationBean);
if (testItemDurationBean != null) {
Double testDuration = CommonUtils.getRounded(testItemDurationBean.getRoundedMsDifference()
.doubleValue(), 3);
LOG.debug("testItemDurationBean.getRoundedMsDifference():" + testDuration);
writableRow.put(Loader.DURATION, testDuration);
}
}