[OpenJDK 2D-Dev] [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop
Shashidhara Veerabhadraiah
shashidhara.veerabhadraiah at oracle.com
Tue Jun 6 05:54:17 UTC 2017
The manual test template that I received from the team seems buggy and an older version it seems. I have modified the same per your inputs and now placed the updated Webrev at http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_02/.
Thanks and regards,
Shashi
From: Prasanta Sadhukhan
Sent: Monday, June 5, 2017 12:35 PM
To: Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>; 2d-dev at openjdk.java.net
Cc: Philip Race <philip.race at oracle.com>
Subject: Re: [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop
I guess there is one more problem in usage of CountDown latch. Have you seen this test fail with timeout even if you wait for 5 minutes as per your timeout period?
latch.await() needs to be wait on main thread while the test needs to be executed in another thread otherwise, pageDialog being modal the control will not come to latch.await()
Iguess you need to do this.
TestUI test = new TestUI(latch);
Thread T1 = new Thread(test);
T1.start();
class TestUI implements Runnable {
...
@Override
public void run() {
try {
createUI();
Regards
Prasanta
On 6/2/2017 4:00 PM, Shashidhara Veerabhadraiah wrote:
Hi, I have fixed the comments below and updated the webrev @ HYPERLINK "http://cr.openjdk.java.net/%7Epkbalakr/shashi/6949753/webrev_01/"http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_01/
Thanks and regards,
Shashi
From: Prasanta Sadhukhan
Sent: Friday, June 2, 2017 12:36 PM
To: Shashidhara Veerabhadraiah HYPERLINK "mailto:shashidhara.veerabhadraiah at oracle.com"<shashidhara.veerabhadraiah at oracle.com>; HYPERLINK "mailto:2d-dev at openjdk.java.net"2d-dev at openjdk.java.net
Cc: Philip Race HYPERLINK "mailto:philip.race at oracle.com"<philip.race at oracle.com>
Subject: Re: [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop
Test fix look ok. Only thing is, you can call getPrinterJob() once and reutilise instead of calling 3 times and probably there is no need of creating a function createNewPrintPageSetup() for it (as it calls 1 method) but it is upto you.
Few comments:
Copyright should have "," after 2017.
I guess createUI() does not have any call that throws exception so no need to have try-catch block for createUI().
Also, there is no need to catch PrinterException and rethrow RuntimeException, so you can do away with that try-catch.
Also, you can call disposeUI() in passButton and failButton actionlistener instead of in main(). Also, there is no need to do setVisible(false) in disposeUI(), dispose() will take care of that.
You can throw RuntimeException when test timed out (instead of just println and later getting test fail exception) which is different from Test Failed RuntimeException.
Regards
Prasanta
On 6/1/2017 5:10 PM, Shashidhara Veerabhadraiah wrote:
Hi All,
Please review a fix for a test bug which contained an infinite loop to test the printer setup dialog's margin attributes retention without the manual step procedure.
The issue with PDialogTest.java which tests the printer setup dialog's margin attributes retention by having as infinite loop to keep popping up the dialog without a proper exit. The test does not cover the instruction steps necessary to properly test dialog's margin attributes retention.
The updated test file includes the standard manual test template along with test cases to cover the printer dialog's margin attributes retention feature.
Bug:
HYPERLINK "https://bugs.openjdk.java.net/browse/JDK-6949753"<https://bugs.openjdk.java.net/browse/JDK-6949753>
Webrev:
HYPERLINK "http://cr.openjdk.java.net/%7Epkbalakr/shashi/6949753/webrev_00/"<http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_00/>
Note : PrintDialog on Mac does not show page margins and hence this test does not run on Mac.
Thanks and regards,
Shashi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20170605/8758b1ae/attachment-0001.html>
More information about the 2d-dev
mailing list