Package org.junit.internal.runners

Examples of org.junit.internal.runners.JUnit38ClassRunner


   * Run all the tests contained in JUnit 3.8.x <code>test</code>. Here for backward compatibility.
   * @param test the old-style test
   * @return a {@link Result} describing the details of the test run and the failed tests.
   */
  public Result run(junit.framework.Test test) {
    return run(new JUnit38ClassRunner(test));
  }
View Full Code Here


    if (each.toString().startsWith(MALFORMED_JUNIT_3_TEST_CLASS_PREFIX))
      // This is cheating, because it runs the whole class
      // to get the warning for this method, but we can't do better,
      // because JUnit 3.8's
      // thrown away which method the warning is for.
      return new JUnit38ClassRunner(new TestSuite(getMalformedTestClass(each)));
    Class<?> type= each.getTestClass();
    if (type == null)
      throw new RuntimeException("Can't build a runner from description [" + each + "]");
    String methodName= each.getMethodName();
    if (methodName == null)
View Full Code Here

  @Test
  public void filterSingleMethodFromOldTestClass() throws Exception {
    final Description method= Description.createTestDescription(
        TwoOldTests.class, "testOne");
    Filter filter= Filter.matchMethodDescription(method);
    JUnit38ClassRunner child= new JUnit38ClassRunner(TwoOldTests.class);
    child.filter(filter);
    assertEquals(1, child.testCount());
  }
View Full Code Here

     
    }
  }
 
  @Test public void plansDecoratorCorrectly() {
    JUnit38ClassRunner runner= new JUnit38ClassRunner(new TestDecorator(new TestSuite(MyTest.class)));
    assertEquals(1, runner.testCount());
  }
View Full Code Here

      Assert.fail();
    }
  }
 
  @Test public void canUnadaptAnAdapter() {
    JUnit38ClassRunner runner= new JUnit38ClassRunner(new JUnit4TestAdapter(AnnotatedTest.class));
    Result result= new JUnitCore().run(runner);
    Failure failure= result.getFailures().get(0);
    assertEquals(Description.createTestDescription(AnnotatedTest.class, "foo"), failure.getDescription());
  }
View Full Code Here

    RunListener listener= result.createListener();
    RunNotifier notifier= new RunNotifier();
    notifier.addFirstListener(listener);
    TestCase testCase= new TestCase() {
    };
    TestListener adaptingListener= new JUnit38ClassRunner(testCase)
        .createAdaptingListener(notifier);
    adaptingListener.addFailure(testCase, new AssertionFailedError());
    assertEquals(1, result.getFailureCount());
  }
View Full Code Here

public class JUnit3Builder extends RunnerBuilder {
  @Override
  public Runner runnerForClass(Class<?> testClass) throws Throwable {
    if (isPre4Test(testClass))
      return new JUnit38ClassRunner(testClass);
    return null;
  }
View Full Code Here

   * Run all the tests contained in JUnit 3.8.x <code>test</code>. Here for backward compatibility.
   * @param test the old-style test
   * @return a {@link Result} describing the details of the test run and the failed tests.
   */
  public Result run(junit.framework.Test test) {
    return run(new JUnit38ClassRunner(test));
  }
View Full Code Here

   * Run all the tests contained in JUnit 3.8.x <code>test</code>. Here for backward compatibility.
   * @param test the old-style test
   * @return a {@link Result} describing the details of the test run and the failed tests.
   */
  public Result run(junit.framework.Test test) {
    return run(new JUnit38ClassRunner(test));
  }
View Full Code Here

     
    }
  }
 
  @Test public void plansDecoratorCorrectly() {
    JUnit38ClassRunner runner= new JUnit38ClassRunner(new TestDecorator(new TestSuite(MyTest.class)));
    assertEquals(1, runner.testCount());
  }
View Full Code Here

TOP

Related Classes of org.junit.internal.runners.JUnit38ClassRunner

Copyright © 2018 www.massapicom. 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.