Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@BeforeParam/@AfterParam for Parameterized runner #1435

Merged
merged 18 commits into from
Apr 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/org/junit/runners/Parameterized.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@
* }
* </pre>
*
* <h3>Executing code before/after executing tests for a specific parameter</h3>
* <p>
* If your test needs to perform some preparation or cleanup based on the parameters this can be
* done by adding public static methods annotated with &#064;BeforeParam/&#064;AfterParam,
* such methods should either have no parameters or have same parameters as the test.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace this paragraph with:

 * If your test needs to perform some preparation or cleanup based on the
 * parameters, this can be done by adding public static methods annotated with
 * {@code @BeforeParam}/{@code @AfterParam}. Such methods should either have no
 * parameters or the same parameters as the test.

* <pre>
* &#064;BeforeParam
* public static void beforeTestsForParameter(String onlyParameter) {
* System.out.println("Testing " + onlyParameter);
* }
* </pre>
* </p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the </p> line.

*
* <h3>Create different runners</h3>
* <p>
* By default the {@code Parameterized} runner creates a slightly modified
Expand Down