fi.jumi.api.drivers.Driver Maven / Gradle / Ivy
// Copyright © 2011-2013, Esko Luontola
// This software is released under the Apache License 2.0.
// The license text is at http://www.apache.org/licenses/LICENSE-2.0
package fi.jumi.api.drivers;
import javax.annotation.concurrent.NotThreadSafe;
import java.io.Serializable;
import java.util.concurrent.Executor;
/**
* Each testing framework should provide its own {@code Driver} implementation so that the Jumi test runner will know
* how to run tests written using that testing framework.
*/
@NotThreadSafe
public abstract class Driver {
/**
* Starts the execution of the tests in {@code testClass}.
*
* The provided {@link Executor} should be used to run the tests, so that they can be executed in parallel, each
* test in a different thread.[1] If the {@link Runnable}s passed to {@code executor} are {@link
* Serializable}, then each of the tests in one class could potentially be executed on different machine in a server
* cluster.[citation needed] Otherwise any potential clustering is at class-granularity[citation
* needed] (which may be a hindrance for classes with many slow tests).
*
* @param testClass contains the tests to be executed.
* @param notifier through which Jumi is told about test executions.
* @param executor recommended for executing tests asynchronously, instead of running them synchronously in this
* method.
* @reference [1]:
* tests_are_run_in_parallel
*/
public abstract void findTests(Class> testClass, SuiteNotifier notifier, Executor executor);
}