/** * 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)); }
/** * 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)); }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { return runner(new ErrorReportingRunner(e, classes)); } }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { throw new RuntimeException( "Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * 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)); }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { throw new RuntimeException( "Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * 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)); }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { throw new RuntimeException( "Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { throw new RuntimeException( "Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { throw new RuntimeException( "Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public static Request classes(Computer computer, Class<?>... classes) { try { AllDefaultPossibilitiesBuilder builder = new AllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return runner(suite); } catch (InitializationError e) { throw new RuntimeException( "Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public Request classes(Computer computer, Class<?>... classes) { try { //For Android AllDefaultPossibilitiesBuilder builder = new AndroidAllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return Request.runner(suite); } catch (InitializationError e) { throw new RuntimeException("Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
/** * Create a <code>Request</code> that, when processed, will run all the tests * in a set of classes. * @param computer Helps construct Runners from classes * @param classes the classes containing the tests * @return a <code>Request</code> that will cause all tests in the classes to be run */ public Request classes(Computer computer, Class<?>... classes) { try { //For Android AllDefaultPossibilitiesBuilder builder = new AndroidAllDefaultPossibilitiesBuilder(true); Runner suite = computer.getSuite(builder, classes); return Request.runner(suite); } catch (InitializationError e) { throw new RuntimeException("Bug in saff's brain: Suite constructor, called as above, should always complete"); } }
private static Result runWithJUnit(final Runner runner) { return new JUnitCore().run(Request.runner(runner)); } }
private static Result runWithJUnit(final Runner runner) { return new JUnitCore().run(Request.runner(runner)); }
try { ClassLoaderStack.push(testClass.getClassLoader()); testResult = c.run(Request.runner(runner)); } finally { ClassLoaderStack.pop();
public static void run(Configuration configuration, Class<?> clazz, String methodName) { try { Request request = null; if (clazz!=null && methodName!=null) { request = Request.method(clazz, methodName); } else { Suite suite = new Suite(new JUnit4Builder(), API_TEST_CLASSES); request = Request.runner(suite); } Configuration originalConfiguration = WorkflowTest.cachedConfiguration; WorkflowTest.cachedConfiguration = configuration; JUnitCore junitCore = new JUnitCore(); Result result = junitCore.run(request); WorkflowTest.cachedConfiguration = originalConfiguration; checkResult(result); } catch (Exception e) { throw new RuntimeException(e); } }