RFR: JDK-8222323: ChildAlwaysOnTopTest.java fails with "RuntimeException: Failed to unset alwaysOnTop" [v2]
Alexander Zuev
kizune at openjdk.java.net
Thu May 5 15:58:17 UTC 2022
On Wed, 4 May 2022 22:39:12 GMT, Harshitha Onkar <duke at openjdk.java.net> wrote:
>> This test case tests the functionality of `setAlwaysOnTop`.
>> Documentation on `setAlwaysOnTop`: [Link](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/Window.html#setAlwaysOnTop(boolean))
>>
>> The following test case was seen to fail on windows and linux platforms. With the proposed fix, the test case works on all platforms.
>>
>> The test case tests `alwaysOnTop` for the following three cases:
>>
>> 1. JDialog with no parent/owner
>> 2. JDialog with JFrame as owner
>> 3. JDialog with another JDialog as owner
>>
>> Each of the three cases mentioned above is tested under 3 scenarios:
>> 
>
> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision:
>
> added changes to continue testing and exception thrown at end in case of failure
test/jdk/java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java line 243:
> 241: System.out.println("Case "+ caseNo + errorMsg[scenarioNo - 1]
> 242: +" Expected Color: "+ expectedColor +" vs Actual Color: "
> 243: + actualColor);
Here instead of just printing out the error i would save it into the static StringBuilder that i would allocate at the beginning of the test. Then when we are concluding testing i would just check if the buffer is empty and if it is not i would throw an RuntimeException with the buffer content. This way we would have all the errors reported by the JavaTest suite in the HTML report and this will make it into the whatever testing environment report we are running tests in. Also that would replace the errorFlag variable since emptiness of the buffer will be an indication of test pass.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8509
More information about the client-libs-dev
mailing list