-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8343124: Tests fails with java.lang.IllegalAccessException: class com.sun.javatest.regtest.agent.MainWrapper$MainTask cannot access #21780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
….sun.javatest.regtest.agent.MainWrapper cannot access
….sun.javatest.regtest.agent.MainWrapper cannot access
👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into |
@prsadhuk This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 283 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
import javax.print.attribute.HashPrintRequestAttributeSet; | ||
|
||
public class StreamPrintingOrientation implements Printable { | ||
public StreamPrintingOrientation() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
return; | ||
} | ||
arg = Integer.parseInt(args[0]); | ||
PrintDlgPageable pd = new PrintDlgPageable(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pd
unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
} | ||
|
||
//printable interface | ||
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throws PrinterException
not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is required...See java.awt.print.Printable spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor formatting changes.
@@ -26,104 +26,120 @@ | |||
* @bug 4869502 4869539 | |||
* @key printer | |||
* @summary Confirm that ToPage is populated for argument =2. Range is disabled for argument = 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @summary Confirm that ToPage is populated for argument =2. Range is disabled for argument = 0. | |
* @summary Confirm that ToPage is populated for argument = 2. Range is disabled for argument = 0. |
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra blank line can be removed.
.columns(35) | ||
.build(); | ||
|
||
System.out.println("open PrintDialog.."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print statements can be logged in PFJ's logarea.
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException { | ||
|
||
// Simply draw two rectangles | ||
Graphics2D g2 = (Graphics2D)g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Graphics2D g2 = (Graphics2D)g; | |
Graphics2D g2 = (Graphics2D) g; |
g2.drawRect(1,1,200,300); | ||
g2.drawRect(1,1,25,25); | ||
System.out.println("print method called "+pi + " Orientation "+pf.getOrientation()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
g2.drawRect(1,1,200,300); | |
g2.drawRect(1,1,25,25); | |
System.out.println("print method called "+pi + " Orientation "+pf.getOrientation()); | |
g2.drawRect(1, 1, 200, 300); | |
g2.drawRect(1, 1, 25, 25); | |
System.out.println("print method called " + pi + " Orientation " + pf.getOrientation()); |
System.out.println("\nValues in attr set passed to print method"); | ||
Attribute attr[] = prSet.toArray(); | ||
for (int x = 0; x < attr.length; x ++) { | ||
System.out.println("Name "+attr[x].getName()+" "+attr[x]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.out.println("Name "+attr[x].getName()+" "+attr[x]); | |
System.out.println("Name "+ attr[x].getName() + " " + attr[x]); |
service = factories[0].getPrintService(fos); | ||
|
||
if (service != null) { | ||
System.out.println("Stream Print Service "+service); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.out.println("Stream Print Service "+service); | |
System.out.println("Stream Print Service " + service); |
if (factories.length > 0) | ||
service = factories[0].getPrintService(fos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (factories.length > 0) | |
service = factories[0].getPrintService(fos); | |
if (factories.length > 0) { | |
service = factories[0].getPrintService(fos); | |
} |
|
||
if (Files.mismatch(fl.toPath(), fp.toPath()) == -1) { | ||
throw new RuntimeException("Printing stream orientation is same for both PORTRAIT and LANDSCAPE"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please limit it to 80 cols.
System.out.println("StreamPrinting Test Width "+pf.getWidth()+" Height "+pf.getHeight()); | ||
g2.drawRect(1,1,200,300); | ||
g2.drawRect(1,1,25,25); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.out.println("StreamPrinting Test Width "+pf.getWidth()+" Height "+pf.getHeight()); | |
g2.drawRect(1,1,200,300); | |
g2.drawRect(1,1,25,25); | |
System.out.println("StreamPrinting Test Width " + pf.getWidth() + " Height " + pf.getHeight()); | |
g2.drawRect(1, 1, 200, 300); | |
g2.drawRect(1, 1, 25, 25); |
fixed.. |
@@ -119,14 +116,14 @@ public Printable getPrintable(int pageIndex) { | |||
} | |||
|
|||
public PageFormat getPageFormat(int pageIndex) { | |||
System.out.println("getPageFormat called "+pageIndex); | |||
System.out.println("getPageFormat called " + pageIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be logged by PFJ's logArea.
|
||
if (arg == 0) { | ||
INSTRUCTIONS += "\n Confirm that page range is disabled."; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blank line not required.
} | ||
catch (PrinterException pe) { | ||
pe.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
catch (PrinterException pe) { | |
pe.printStackTrace(); | |
} catch (PrinterException pe) { | |
pe.printStackTrace(); |
PassFailJFrame.log("Orientation returned from Pageable " + findOrientation(pf.getOrientation())); | ||
return pf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code...can be moved outside of if..else
block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the whole method as logging for printing is not needed for this PageRange check test
} else if (orient == PageFormat.REVERSE_LANDSCAPE) { | ||
return "REVERSE LANDSCAPE"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it required to check for REVERSE_LANDSCAPE
as page formatting is set only either LANDSCAPE
or PORTRAIT
?
PrintService service = null; | ||
|
||
FileOutputStream fos = null; | ||
File fl = null, fp = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please declare it on separate lines as per java style coding.
FileOutputStream fos = null; | ||
File fl = null, fp = null; | ||
String mType = "application/postscript"; | ||
|
||
class StreamPrintingOrientation implements Printable { | ||
/** | ||
* Constructor | ||
*/ | ||
public StreamPrintingOrientation() { | ||
super(); | ||
fl = new File("stream_landscape.ps"); | ||
fl.deleteOnExit(); | ||
fos = new FileOutputStream(fl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be rearranged something like..
String mType = "application/postscript";
File fp = null;
File fl = new File("stream_landscape.ps");
fl.deleteOnExit();
FileOutputStream fos = new FileOutputStream(fl);
} | ||
// Simply draw two rectangles | ||
Graphics2D g2 = (Graphics2D)g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Graphics2D g2 = (Graphics2D)g; | |
Graphics2D g2 = (Graphics2D) g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except minor change suggested.
@@ -57,10 +57,9 @@ public static void main(String[] args) throws Exception { | |||
PrintService service = null; | |||
|
|||
FileOutputStream fos = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be moved to L64.
/integrate |
Going to push as commit dafa2e5.
Your commit was automatically rebased without conflicts. |
Couple of printing tests dont have "public" modifier so CI testing fails to run this test citing IllegalAccessException.
Fix is made to made the test class public.
Additionally, modified PrintDlgPageable.java to use PFJ and made StreamPrintingOrientation.java automated.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21780/head:pull/21780
$ git checkout pull/21780
Update a local copy of the PR:
$ git checkout pull/21780
$ git pull https://git.openjdk.org/jdk.git pull/21780/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21780
View PR using the GUI difftool:
$ git pr show -t 21780
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21780.diff
Using Webrev
Link to Webrev Comment