[rfc][icedtea-web][policyeditor] Unit tests fix after last PolicyEditor async IO patch
Lukasz Dracz
ldracz at redhat.com
Tue Jun 3 20:31:23 UTC 2014
----- Original Message -----
> From: "Andrew Azores" <aazores at redhat.com>
> To: "IcedTea" <distro-pkg-dev at openjdk.java.net>
> Sent: Monday, June 2, 2014 5:07:49 PM
> Subject: [rfc][icedtea-web][policyeditor] Unit tests fix after last PolicyEditor async IO patch
>
> Hi,
>
> There's a race between the unit tests and PolicyEditor instances that is
> causing several PolicyEditor tests to sporadically fail, due to the
> tests asserting certain conditions about the contents of the policy file
> model before it has actually been opened and parsed. This patch fixes
> the race by adding a "performingIO" field to the editor, which is simply
> marked true immediately before starting an IO operation and marked false
> immediately after completing it. The test cases then poll the editor
> every 50ms, waiting for it to complete its IO, before performing the
> actual tests.
>
> Additionally, the new progress bar dialog which appears during blocking
> IO does so assuming that the editor panel is contained within some
> window, which it uses as its parent to set its modality and to center
> itself. However, this is not necessarily the case - PolicyEditor can
> actually be used headless, and is used headless during the unit tests.
> The dialog appears during the unit tests regardless of the fact that
> there is no parent window. This is solved by simply checking if the
> parent window of the editor panel is null, and if it is, not invoking
> the Runnable which displays the progress indicator.
>
> Thanks,
>
> --
> Andrew A
>
>
Hello,
Patch looks good to me, it fixes the tests on my system.
+0.5 from me.
Thank you,
Lukasz D
More information about the distro-pkg-dev
mailing list