@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
ITestCase testCase = (ITestCase) invocation.getThis();
Object[] args = invocation.getArguments();
Context context = (Context) args[CONTEXT];
JUnitResult jUnitResult;
if (context instanceof JUnitResultHolder) {
jUnitResult = ((JUnitResultHolder) context).getJUnitResult();
jUnitResult.startTestCase((ITestSuite) args[PARENT], testCase);
} else {
jUnitResult = null;
}
StopWatch sw = testCase.getStopWatch();
LogRecorder clr = new LogRecorder(context.getPrintStream());
testCase.setLogRecorder(clr);
sw.start();
if (!testCase.isError()) {
log.info("Start: {}", testCase);
clr.info("Start: " + testCase);
}
if (testCase instanceof TestCase) {
String baseURL = StringUtils.defaultString(context.getOverridingBaseURL(), ((TestCase) testCase).getBaseURL());
log.info("baseURL: {}", baseURL);
clr.info("baseURL: " + baseURL);
}
try {
Result result = (Result) invocation.proceed();