/** * [ISuiteListener] * This method is invoked before the SuiteRunner starts. * * @param suite current test suite */ @Override public void onStart(ISuite suite) { suite.setAttribute(LISTENER_CHAIN, this); synchronized(suiteListeners) { for (ISuiteListener suiteListener : Lists.reverse(suiteListeners)) { suiteListener.onStart(suite); } } }
/** * [ISuiteListener] * This method is invoked after the SuiteRunner has run all * the test suites. * * @param suite current test suite */ @Override public void onFinish(ISuite suite) { synchronized(suiteListeners) { for (ISuiteListener suiteListener : suiteListeners) { suiteListener.onFinish(suite); } } }
private ITestListener createProxy(Class<?> configListenerClass, final ITestListener listener) { Class<?>[] interfaces = new Class<?>[]{ITestListener.class, ISuiteListener.class, configListenerClass}; return (ITestListener) Proxy.newProxyInstance(classLoader, interfaces, new AdaptedListener(listener)); }