You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78Lines changed: 78 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -594,6 +594,84 @@ public class ArtifactCollectorJUnitParams implements ArtifactParams {
594
594
}
595
595
```
596
596
597
+
The following example demonstrates how to publish invocation parameters with the [TestParameterInjector](https://github.com/google/TestParameterInjector) runner. The implementation is more complex than the `Parameterized` example above, due to the strategy used by the runner to inject parameters into the test methods.
598
+
599
+
The `TestParameterInjector` runner supports a variety of methods to inject parameters. Test parameters can be provided by test class fields, test method arguments, or both. When test method arguments are used, these are populated from a `parameters` list in a `testInfo` object that's been added to the **JUnit** framework method. Unlike the `Parameterized` runner, where all test methods in the class run with the same set of values, the `TestParameterInjector` runner allows each test method in the class to run with its own unique set of values. This variability must be accounted for in the implementation of the `getParameters()` method.
600
+
601
+
The example below queries the method for its parameter types, then uses these to cast each injected value to its corresponding type.
For scenarios that require artifact capture of parameterized tests, the [ArtifactCollector](https://github.com/sbabcoc/JUnit-Foundation/blob/master/src/main/java/com/nordstrom/automation/junit/ArtifactCollector.java) class extends the [AtomIdentity](https://github.com/sbabcoc/JUnit-Foundation/blob/master/src/main/java/com/nordstrom/automation/junit/AtomIdentity.java) test rule. This enables artifact type implementations to access invocation parameters and **Description** object for the current `atomic test`. For more details, see the [Artifact Capture](#artifact-capture) section below.
0 commit comments