/** * Register the supplied list of {@link TestExecutionListener TestExecutionListeners} * by appending them to the list of listeners used by this {@code TestContextManager}. * @see #registerTestExecutionListeners(TestExecutionListener...) */ public void registerTestExecutionListeners(List<TestExecutionListener> testExecutionListeners) { registerTestExecutionListeners(testExecutionListeners.toArray(new TestExecutionListener[0])); }
/** * Construct a new {@code TestContextManager} using the supplied {@link TestContextBootstrapper} * and {@linkplain #registerTestExecutionListeners register} the necessary * {@link TestExecutionListener TestExecutionListeners}. * <p>Delegates to the supplied {@code TestContextBootstrapper} for building * the {@code TestContext} and retrieving the {@code TestExecutionListeners}. * @param testContextBootstrapper the bootstrapper to use * @see TestContextBootstrapper#buildTestContext * @see TestContextBootstrapper#getTestExecutionListeners * @see #registerTestExecutionListeners */ public TestContextManager(TestContextBootstrapper testContextBootstrapper) { this.testContext = testContextBootstrapper.buildTestContext(); registerTestExecutionListeners(testContextBootstrapper.getTestExecutionListeners()); }
public SpringTestContextManager(Class<?> testClass) { delegate = new TestContextManager(testClass); if (!testContextBootstrapperAvailable) { delegate.registerTestExecutionListeners(new SpringMockTestExecutionListener()); } }
/** * Register the supplied list of {@link TestExecutionListener TestExecutionListeners} * by appending them to the list of listeners used by this {@code TestContextManager}. * @see #registerTestExecutionListeners(TestExecutionListener...) */ public void registerTestExecutionListeners(List<TestExecutionListener> testExecutionListeners) { registerTestExecutionListeners(testExecutionListeners.toArray(new TestExecutionListener[0])); }
/** * Register the supplied list of {@link TestExecutionListener TestExecutionListeners} * by appending them to the list of listeners used by this {@code TestContextManager}. * @see #registerTestExecutionListeners(TestExecutionListener...) */ public void registerTestExecutionListeners(List<TestExecutionListener> testExecutionListeners) { registerTestExecutionListeners(testExecutionListeners.toArray(new TestExecutionListener[testExecutionListeners.size()])); }
public JUnitScenarioRunner(Class<? extends ScenarioHandler> clazz, Scenario scenario) throws InitializationError { super(clazz); this.scenario = Objects.requireNonNull(scenario); getTestContextManager().registerTestExecutionListeners(this); }
private SpringZuchini(Class<?> testClass, ScopeExecutionListener scopeExecutionListener) throws Exception { super(testClass, Collections.<Runner>singletonList(delegate(testClass, scopeExecutionListener))); this.testContextManager = new TestContextManager(testClass); this.testContextManager.registerTestExecutionListeners(scopeExecutionListener); }
/** * Default constructor using class to run. * @param clazz the test class to be run */ public CitrusJUnit4Runner(Class<?> clazz) throws InitializationError { super(clazz); getTestContextManager().registerTestExecutionListeners(new TestSuiteExecutionListener()); }
/** * Construct a new {@code TestContextManager} using the supplied {@link TestContextBootstrapper} * and {@linkplain #registerTestExecutionListeners register} the necessary * {@link TestExecutionListener TestExecutionListeners}. * <p>Delegates to the supplied {@code TestContextBootstrapper} for building * the {@code TestContext} and retrieving the {@code TestExecutionListeners}. * @param testContextBootstrapper the bootstrapper to use * @see TestContextBootstrapper#buildTestContext * @see TestContextBootstrapper#getTestExecutionListeners * @see #registerTestExecutionListeners */ public TestContextManager(TestContextBootstrapper testContextBootstrapper) { this.testContext = testContextBootstrapper.buildTestContext(); registerTestExecutionListeners(testContextBootstrapper.getTestExecutionListeners()); }
/** * Construct a new {@code TestContextManager} using the supplied {@link TestContextBootstrapper} * and {@linkplain #registerTestExecutionListeners register} the necessary * {@link TestExecutionListener TestExecutionListeners}. * <p>Delegates to the supplied {@code TestContextBootstrapper} for building * the {@code TestContext} and retrieving the {@code TestExecutionListeners}. * @param testContextBootstrapper the bootstrapper to use * @see TestContextBootstrapper#buildTestContext * @see TestContextBootstrapper#getTestExecutionListeners * @see #registerTestExecutionListeners */ public TestContextManager(TestContextBootstrapper testContextBootstrapper) { this.testContext = testContextBootstrapper.buildTestContext(); registerTestExecutionListeners(testContextBootstrapper.getTestExecutionListeners()); }
try { final TestExecutionListener listener = (TestExecutionListener)Class.forName(className).newInstance(); getTestContextManager().registerTestExecutionListeners(listener); } catch (final Exception e) { LOG.info("Failed while attempting to load default unit test listener class {}: {}", className, e.getLocalizedMessage()); for (final TestExecutionListener listener : listeners) { if (!standardListeners.contains(listener)) { getTestContextManager().registerTestExecutionListeners(listener);