Skip to content

Commit c3ce768

Browse files
authored
Revise to add information about support for parallel execution
1 parent 004a30b commit c3ce768

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ The preceding **ServiceLoader** provider configuration files declare a **JUnit F
234234
**RunnerWatcher** provides callbacks for events in the lifecycle of **`ParentRunner`** objects. It receives the following notifications:
235235
* A **`ParentRunner`** object is about to run.
236236
* A **`ParentRunner`** object has finished running.
237-
* [TestClassWatcher](https://github.com/Nordstrom/JUnit-Foundation/blob/master/src/main/java/com/nordstrom/automation/junit/TestClassWatcher.java)
238-
**TestClassWatcher** provides callbacks for events in the lifecycle of **`TestClass`** objects. It receives the following notifications:
239-
* A **`TestClass`** object has been created to represent a JUnit test class or suite.
240-
* **NOTE** - Test executers like Maven Surefire create suite runners for their own purposes (e.g. - parallel execution context). This breaks the one-to-one relationship between **`TestClass`** objects and runners. Consequently, the **`TestClass`** object cannot be assumed to represent a unique context.
241237
* [TestObjectWatcher](https://github.com/Nordstrom/JUnit-Foundation/blob/master/src/main/java/com/nordstrom/automation/junit/TestObjectWatcher.java)
242238
**TestObjectWatcher** provides callbacks for events in the lifecycle of Java test class instances. It receives the following notification:
243239
* An instance of a JUnit test class has been created for the execution of a single `atomic test`.
@@ -309,6 +305,10 @@ Note that the implementation in this method watcher uses the annotations attache
309305

310306
As indicated previously, **JUnit Foundation** will automatically attach standard JUnit **RunListener** providers that are declared in the associated **ServiceLoader** provider configuration file (i.e. - **_org.junit.runner.notification.RunListener_**). Declared run listeners are attached to the **RunNotifier** supplied to the `run()` method of JUnit runners. This feature eliminates behavioral differences between the various test execution environments like Maven, Gradle, and native IDE test runners.
311307

308+
### Support for Parallel Execution
309+
310+
The ability to run **JUnit** tests in parallel is provided by the JUnit 4 test runner of the [Maven Surefire plugin](https://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html). This feature utilizes private **JUnit** interfaces and undocuments behaviors, which greatly complicated the task of adding event notification hooks. As of version [9.0.1](https://github.com/Nordstrom/JUnit-Foundation/releases/tag/junit-foundation-9.0.1), **JUnit Foundation** supports parallel execution of both classes and methods.
311+
312312
### Support for Parameterized Tests
313313

314314
**JUnit** provides a custom [Parameterized](https://junit.org/junit4/javadoc/4.12/org/junit/runners/Parameterized.html) runner for executing parameterized tests. Third-party solutions are also available, such as [JUnitParams](https://github.com/Pragmatists/JUnitParams) and [ParameterizedSuite](https://github.com/PeterWippermann/parameterized-suite). Each of these solutions has its own implementation strategy, and no common interface is provided to access the parameters supplied to each invocation of the test methods in the parameterized class.

0 commit comments

Comments
 (0)