void (IDEATestNGRemoteListener listener) { addListener((Object)new IDEATestNGSuiteListener(listener)); addListener((Object)new IDEATestNGTestListener(listener)); try { Class<?> configClass = Class.forName("com.intellij.rt.testng.IDEATestNGConfigurationListener"); Object configurationListener = configClass.getConstructor(new Class[] {IDEATestNGRemoteListener.class}).newInstance(listener); addListener(configurationListener); Class<?> invokeClass = Class.forName("com.intellij.rt.testng.IDEATestNGInvokedMethodListener"); Object invokedMethodListener = invokeClass.getConstructor(new Class[]{IDEATestNGRemoteListener.class}).newInstance(listener); addListener(invokedMethodListener); //start with configuration started if invoke method listener was not added, otherwise with configClass.getMethod("setIgnoreStarted").invoke(configurationListener); } catch (Throwable ignored) {} }