Package org.junit.internal.runners

Examples of org.junit.internal.runners.ErrorReportingRunner


import org.junit.internal.runners.ErrorReportingRunner;

public class ErrorReportingRunnerTest {
    @Test(expected = NullPointerException.class)
    public void cannotCreateWithNullClass() {
        new ErrorReportingRunner(null, new RuntimeException());
    }
View Full Code Here


        try {
            Runner runner = request.getRunner();
            fFilter.apply(runner);
            return runner;
        } catch (NoTestsRemainException e) {
            return new ErrorReportingRunner(Filter.class, new Exception(String
                    .format("No tests found matching %s from %s", fFilter
                            .describe(), request.toString())));
        }
    }
View Full Code Here

            public Runner getRunner() {
                try {
                    return new Suite((Class<?>) null, runners) {
                    };
                } catch (InitializationError e) {
                    return new ErrorReportingRunner(null, e);
                }
            }
        };
    }
View Full Code Here

    /**
     * Creates a {@link Request} that, when processed, will report an error for the given
     * test class with the given cause.
     */
    public static Request errorReport(Class<?> klass, Throwable cause) {
        return runner(new ErrorReportingRunner(klass, cause));
    }
View Full Code Here

    List<Throwable> goofs= getCauses(fCause);
    CompositeRunner runner= new CompositeRunner(fClass.getName());
    for (int i= 0; i < goofs.size(); i++) {
      final Description description= Description.createTestDescription(fClass, "initializationError" + i);
      final Throwable throwable= goofs.get(i);
      runner.add(new ErrorReportingRunner(description, throwable));
    }
    return runner;
  }
View Full Code Here

  /**
   * Not used within JUnit.  Clients should simply instantiate ErrorReportingRunner themselves
   */
  @Deprecated 
  public static Request errorReport(Class<?> klass, Throwable cause) {
    return runner(new ErrorReportingRunner(klass, cause));
  }
View Full Code Here

      @Override
      public Runner getRunner() {
        try {
          return new Suite((Class<?>)null, runners) {};
        } catch (InitializationError e) {
          return new ErrorReportingRunner(null, e);
        }
      }
    };
  }
View Full Code Here

    try {
      Runner runner= fRequest.getRunner();
      fFilter.apply(runner);
      return runner;
    } catch (NoTestsRemainException e) {
      return new ErrorReportingRunner(Filter.class, new Exception(String
          .format("No tests found matching %s from %s", fFilter
              .describe(), fRequest.toString())));
    }
  }
View Full Code Here

   */
  public Runner safeRunnerForClass(Class<?> testClass) {
    try {
      return runnerForClass(testClass);
    } catch (Throwable e) {
      return new ErrorReportingRunner(testClass, e);
    }
  }
View Full Code Here

    try {
      Runner runner= fRequest.getRunner();
      fFilter.apply(runner);
      return runner;
    } catch (NoTestsRemainException e) {
      return new ErrorReportingRunner(Filter.class, new Exception(String
          .format("No tests found matching %s from %s", fFilter
              .describe(), fRequest.toString())));
    }
  }
View Full Code Here

TOP

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

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.