Examples of TrackingRunListener


Examples of org.springframework.test.context.junit4.TrackingRunListener

  private static final void runTestClassAndAssertStats(Class<?> testClass, int expectedTestCount) {
    final int expectedTestFailureCount = 0;
    final int expectedTestStartedCount = expectedTestCount;
    final int expectedTestFinishedCount = expectedTestCount;

    TrackingRunListener listener = new TrackingRunListener();
    JUnitCore jUnitCore = new JUnitCore();
    jUnitCore.addListener(listener);
    jUnitCore.run(testClass);

    assertEquals("Verifying number of failures for test class [" + testClass + "].", expectedTestFailureCount,
      listener.getTestFailureCount());
    assertEquals("Verifying number of tests started for test class [" + testClass + "].", expectedTestStartedCount,
      listener.getTestStartedCount());
    assertEquals("Verifying number of tests finished for test class [" + testClass + "].",
      expectedTestFinishedCount, listener.getTestFinishedCount());
  }
View Full Code Here

Examples of org.springframework.test.context.junit4.TrackingRunListener

*/
public class ServletContextAwareBeanWacTests {

  @Test
  public void ensureServletContextAwareBeanIsProcessedProperlyWhenExecutingJUnitManually() {
    TrackingRunListener listener = new TrackingRunListener();
    JUnitCore junit = new JUnitCore();
    junit.addListener(listener);

    junit.run(BasicAnnotationConfigWacTests.class);

    assertEquals(3, listener.getTestStartedCount());
    assertEquals(3, listener.getTestFinishedCount());
    assertEquals(0, listener.getTestFailureCount());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.