<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.new
{mso-style-name:new;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle23
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle24
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle25
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1781021954;
mso-list-type:hybrid;
mso-list-template-ids:1732818938 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi All, Please find the updated Webrev with fixes for the comments @ <a href="http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_04/">http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_04/</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks and regards,<br>Shashi<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></a></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Philip Race <br><b>Sent:</b> Thursday, June 8, 2017 3:32 AM<br><b>To:</b> Prasanta Sadhukhan <prasanta.sadhukhan@oracle.com><br><b>Cc:</b> Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah@oracle.com>; 2d-dev@openjdk.java.net<br><b>Subject:</b> Re: [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>.. and please make sure all lines are <= 80 chars as per the coding standards.<br><br>-phil.<br><br>On 6/6/17, 11:59 PM, Prasanta Sadhukhan wrote: <o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p>do_test() does not need to be under EDT as it invokes printer pagedialog and not swing components. Actually, createUI() needs to be under EDT which has not been done.<o:p></o:p></p><p class=MsoNormal>Also, <o:p></o:p></p><pre><span class=new>79 SwingUtilities.invokeAndWait(() -> {</span><o:p></o:p></pre><pre><span class=new> 80 test.disposeUI();</span><o:p></o:p></pre><pre><span class=new> 81 });</span><o:p></o:p></pre><pre><span class=new> 82 }<o:p></o:p></span></pre><pre><span class=new>should be called before you throw RuntimeException when test times out . <o:p></o:p></span></pre><pre><span class=new>There is no need of calling this after<o:p></o:p></span></pre><pre><span class=new>75 if (test.testResult == false) {</span><o:p></o:p></pre><pre><span class=new> 76 throw new RuntimeException("Test Failed.");</span><o:p></o:p></pre><pre><span class=new> 77 }<o:p></o:p></span></pre><pre><span class=new>as it has already been called in pass/fail actionlistener.<o:p></o:p></span></pre><pre><span class=new><o:p> </o:p></span></pre><pre><span class=new>Also, put a sleep after T1.start() and do_test() otherwise since they are in separate thread, in mycase, pagedialog is displayed before test instructions dialog.<o:p></o:p></span></pre><pre><span class=new><o:p> </o:p></span></pre><pre><span class=new>Regards<o:p></o:p></span></pre><pre><span class=new>Prasanta<o:p></o:p></span></pre><div><p class=MsoNormal>On 6/7/2017 11:50 AM, Shashidhara Veerabhadraiah wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi All,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> I have altered the manual test template per the comments.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Have moved the test instructions window under newly created thread.</span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Have moved the print dialog(main test module) under EDT.</span><o:p></o:p></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span style='mso-list:Ignore'>3.<span style='font:7.0pt "Times New Roman"'> </span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Timer management shall be done on the main thread.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I have placed the updated Webrev @ <a href="http://cr.openjdk.java.net/%7Epkbalakr/shashi/6949753/webrev_03/">http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_03/</a></span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Please let me know if any comments on it.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks and regards,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Shashi</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Prasanta Sadhukhan <br><b>Sent:</b> Tuesday, June 6, 2017 11:52 AM<br><b>To:</b> Shashidhara Veerabhadraiah <a href="mailto:shashidhara.veerabhadraiah@oracle.com"><shashidhara.veerabhadraiah@oracle.com></a>; <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><br><b>Cc:</b> Philip Race <a href="mailto:philip.race@oracle.com"><philip.race@oracle.com></a><br><b>Subject:</b> Re: [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p>As I told, pageDialog is modal so latch.await() will not be called if user does not close the page dialog or do any interaction. The actual test<o:p></o:p></p><pre><span class=new>59 PageFormat pageFormat = new PageFormat();</span><o:p></o:p></pre><pre><span class=new> 60 </span><o:p></o:p></pre><pre><span class=new> 61 createNewPrintPageSetup(pageFormat);</span><o:p></o:p></pre><pre><span class=new> 62 </span><o:p></o:p></pre><pre><span class=new> 63 setValuesForPrintPageSetup(pageFormat, 2);</span><o:p></o:p></pre><pre><span class=new> 64 </span><o:p></o:p></pre><pre><span class=new> 65 createNewPrintPageSetup(pageFormat);</span><o:p></o:p></pre><pre><span class=new> 66 </span><o:p></o:p></pre><pre><span class=new> 67 setValuesForPrintPageSetup(pageFormat, 3);</span><o:p></o:p></pre><pre><span class=new> 68 </span><o:p></o:p></pre><pre><span class=new> 69 createNewPrintPageSetup(pageFormat);</span><o:p></o:p></pre><p class=MsoNormal><br>should be done in other thread.<br><br>Regards<br>Prasanta<o:p></o:p></p><div><p class=MsoNormal>On 6/6/2017 11:24 AM, Shashidhara Veerabhadraiah wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>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 <a href="http://cr.openjdk.java.net/%7Epkbalakr/shashi/6949753/webrev_02/">http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_02/</a>.</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks and regards,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Shashi</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Prasanta Sadhukhan <br><b>Sent:</b> Monday, June 5, 2017 12:35 PM<br><b>To:</b> Shashidhara Veerabhadraiah <a href="mailto:shashidhara.veerabhadraiah@oracle.com"><shashidhara.veerabhadraiah@oracle.com></a>; <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><br><b>Cc:</b> Philip Race <a href="mailto:philip.race@oracle.com"><philip.race@oracle.com></a><br><b>Subject:</b> Re: [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p>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?<o:p></o:p></p><p>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()<o:p></o:p></p><p>Iguess you need to do this.<o:p></o:p></p><p>TestUI test = new TestUI(latch);<br> Thread T1 = new Thread(test);<br> T1.start();<o:p></o:p></p><p class=MsoNormal>class TestUI implements Runnable {<br>...<br>@Override<br> public void run() {<br> try {<br> createUI();<br><br>Regards<br>Prasanta<o:p></o:p></p><div><p class=MsoNormal>On 6/2/2017 4:00 PM, Shashidhara Veerabhadraiah wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi, I have fixed the comments below and updated the webrev @ <a href="http://cr.openjdk.java.net/%7Epkbalakr/shashi/6949753/webrev_01/">http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_01/</a></span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks and regards,</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Shashi</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'> </span><o:p></o:p></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Prasanta Sadhukhan <br><b>Sent:</b> Friday, June 2, 2017 12:36 PM<br><b>To:</b> Shashidhara Veerabhadraiah <a href="mailto:shashidhara.veerabhadraiah@oracle.com"><shashidhara.veerabhadraiah@oracle.com></a>; <a href="mailto:2d-dev@openjdk.java.net">2d-dev@openjdk.java.net</a><br><b>Cc:</b> Philip Race <a href="mailto:philip.race@oracle.com"><philip.race@oracle.com></a><br><b>Subject:</b> Re: [9]JDK-6949753:[TEST BUG]: java/awt/print/PageFormat/PDialogTest.java needs update by removing a infinite loop</span><o:p></o:p></p></div></div><p class=MsoNormal> <o:p></o:p></p><p>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<span class=new> createNewPrintPageSetup()</span> for it (as it calls 1 method) but it is upto you.<o:p></o:p></p><p>Few comments:<o:p></o:p></p><p class=MsoNormal>Copyright should have "," after 2017.<br>I guess createUI() does not have any call that throws exception so no need to have try-catch block for createUI().<br>Also, there is no need to catch PrinterException and rethrow RuntimeException, so you can do away with that try-catch.<br>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.<br>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. <br><br>Regards<br>Prasanta<o:p></o:p></p><div><p class=MsoNormal>On 6/1/2017 5:10 PM, Shashidhara Veerabhadraiah wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Hi All,<o:p></o:p></pre><pre>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.<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>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.<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>The updated test file includes the standard manual test template along with test cases to cover the printer dialog's margin attributes retention feature.<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Bug:<o:p></o:p></pre><pre><a href="https://bugs.openjdk.java.net/browse/JDK-6949753"><https://bugs.openjdk.java.net/browse/JDK-6949753></a><o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Webrev:<o:p></o:p></pre><pre><a href="http://cr.openjdk.java.net/%7Epkbalakr/shashi/6949753/webrev_00/"><http://cr.openjdk.java.net/~pkbalakr/shashi/6949753/webrev_00/></a><o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Note : PrintDialog on Mac does not show page margins and hence this test does not run on Mac.<o:p></o:p></pre><pre> <o:p></o:p></pre><pre>Thanks and regards,<o:p></o:p></pre><pre>Shashi<o:p></o:p></pre></blockquote><p class=MsoNormal> <o:p></o:p></p></blockquote><p class=MsoNormal> <o:p></o:p></p></blockquote><p class=MsoNormal> <o:p></o:p></p></blockquote><p class=MsoNormal><o:p> </o:p></p></blockquote></div></body></html>