diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 0c3748bf832d0..031395aaf25dd 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -149,6 +149,15 @@ *
* Before returning from {@code awaitAndCheck}, the framework disposes of * all the windows and frames. + *
+ * There are two other static methods available, + * {@link #forcePass() forcePass} and {@link #forceFail() forceFail}, which can + * be used in semi-automated tests to indicate that the test can be forcefully + * Passed/Failed. These methods are not immediately evaluated, but it decrements + * a counter and return. The evaluation happens in {@code awaitAndCheck} and + * the test will be forcefully Passed/Failed accordingly. + * Code examples are given in the corresponding method javadoc. + *
* *
+ * Use this method in semi-automatic tests when + * the test determines that all/any of the conditions for passing the test are not met. + *
+ * Do not use this method in cases where a resource is unavailable or a + * feature isn't supported, throw {@code jtreg.SkippedException} instead. + * + *
A sample usage can be found in + * {@code + * HorizScrollers.java} */ public static void forceFail() { forceFail("forceFail called"); } /** - * Forcibly fail the test and provide a reason. + * Forcibly fail the test and provide a reason. + *
+ * Use this method in semi-automatic tests when + * the test determines that all/any of the conditions for passing the test are not met. + *
+ * Do not use this method in cases where a resource is unavailable or a + * feature isn't supported, throw {@code jtreg.SkippedException} instead. + * + *
A sample usage can be found in + * {@code + * SaveFileNameOverrideTest.java} * * @param reason the reason why the test is failed */