Skip to content

8355441: Remove antipattern from PassFailJFrame.forcePass javadoc #3743

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

Closed
Closed
Changes from all commits
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
18 changes: 10 additions & 8 deletions test/jdk/java/awt/regtesthelpers/PassFailJFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -1294,14 +1294,16 @@ private static synchronized void showUI() {

/**
* Forcibly pass the test.
* <p>The sample usage:
* <pre><code>
* PrinterJob pj = PrinterJob.getPrinterJob();
* if (pj == null || pj.getPrintService() == null) {
* System.out.println(""Printer not configured or available.");
* PassFailJFrame.forcePass();
* }
* </code></pre>
* <p>
* Use this method in semi-automatic tests when
* the test determines that all the conditions for passing the test are met.
* <p>
* <strong>Do not use</strong> this method in cases where a resource is unavailable or a
* feature isn't supported, throw {@code jtreg.SkippedException} instead.
*
* <p>A sample usage can be found in
* <a href="https://github.com/openjdk/jdk/blob/7283c8b/test/jdk/java/awt/FileDialog/SaveFileNameOverrideTest.java#L84">{@code
* SaveFileNameOverrideTest.java}</a>
*/
public static void forcePass() {
latch.countDown();
Expand Down