diff --git a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java index 0c3748bf832d0..c0a483056df0c 100644 --- a/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java +++ b/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java @@ -150,6 +150,17 @@ * Before returning from {@code awaitAndCheck}, the framework disposes of * all the windows and frames. * + *
+ * For semi-automatic tests, use {@code forcePass} or + * {@code forceFail} methods to forcibly pass or fail the test + * when it's determined that the required conditions are already met + * or cannot be met correspondingly. + * These methods release {@code awaitAndCheck}, and + * the test will complete successfully or fail. + *
+ * Refer to examples of using these methods in the description of the + * {@link #forcePass() forcePass} and {@link #forceFail() forceFail} methods. + * *
+ * Use this method in semi-automatic tests when + * it is determined that the conditions for passing the test cannot be 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 + * it is determined that the conditions for passing the test cannot be 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 */