RFR: 8283803 : Remove jtreg tag manual=yesno for java/awt/print/PrinterJob/PrintGlyphVectorTest.java and fix test [v4]

Alexey Ivanov aivanov at openjdk.java.net
Tue Apr 12 20:29:39 UTC 2022


On Tue, 12 Apr 2022 20:14:26 GMT, lawrence.andrews <duke at openjdk.java.net> wrote:

>> Fixed the following issue.
>> 1) Removed yes/no since test was failing due to "Parser error due to yesno in @run main/manual=yesno"
>> 2) After removing yes/no test run( just shows the UI and gets dispose immediately). User cannot interact with the test UI and mark the test pass or failed. 
>> So added Pass and Fail button to mark the test result.
>> 3) Added timeout if in case user does not interact with the test UI.
>> 
>> @shurymury 
>> @aivanov-jdk
>
> lawrence.andrews has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fixed PrintGlyphVectorTest.java to use PassFailJFrame

test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java line 72:

> 70:         GlyphVector v = font.createGlyphVector(frc, testString);
> 71: 
> 72:         float x = 50f, y = 50f;

A better way would be:

float x = 50f;
float y = 50f;

Declaring the two variables on the same line is discouraged.

test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java line 97:

> 95:     public void paint(Graphics g) {
> 96:         g.setColor(Color.white);
> 97:         g.fillRect(0,0,getSize().width, getSize().height);

Since you're updating the line any way, please add a space after commas.

test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java line 128:

> 126:             if (pj == null || pj.getPrintService() == null ||
> 127:                     !pj.printDialog()) {
> 128:                 return;

Isn't it a failure?

test/jdk/java/awt/print/PrinterJob/PrintGlyphVectorTest.java line 132:

> 130:             pj.setPrintable(new PrintGlyphVectorTest());
> 131:             try {
> 132:                 pj.print();

Does it show Print dialog? Should the test fail if the user clicks Cancel there?

Any exception thrown should also fail the test, we expect no exceptions.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8004



More information about the client-libs-dev mailing list