-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
JDK-8320675 : PrinterJob/SecurityDialogTest.java hangs #18299
Conversation
Rearrange code; Really show native Page Dialog; Get rid of vertical glue, inline the title; Use JLabel to display current dialog tested; Create the label in a thread-safe way; Rename msg to dialogType; Use thread-safe UI updates. Remove unused imports Remove trailing whitespace
👋 Welcome back rkannathpari! A progress list of the required criteria for merging this PR into |
@Renjithkannath 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 134 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. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aivanov-jdk, @TejeshR13) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@Renjithkannath The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
/contributor add aivanov-jdk |
@Renjithkannath Syntax:
User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address. |
/contributor add @aivanov-jdk |
@Renjithkannath |
/reviewers 2 |
@aivanov-jdk |
*/ | ||
public class SecurityDialogTest extends Frame { | ||
private static final String INSTRUCTIONS = |
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.
INSTRUCTIONS
can be moved inside main.
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.
Most of the test with PassFailJFrame instruction stored as string inside class, what additional benefit will get keeping it inside Main ?
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.
When it can become local variable then why to keep it in class? Not like significant benefit maybe, but yeah just to keep its scope locally when it can be.
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.
INSTRUCTIONS can be moved inside main.
No. Well, it can but what's the point?
I find a value in having the instructions as a dedicated constant at the top of the file. When you open the test, the instructions will be the first thing you see, and it's what you need after reading the summary in @summary
tag above the class declaration.
* @test | ||
* @bug 4937672 5100706 6252456 | ||
* @key printer | ||
* @run main/othervm/manual -Djava.security.manager=allow SecurityDialogTest | ||
* @library /java/awt/regtesthelpers | ||
* @build PassFailJFrame |
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.
Any reason why test summary is not there?
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 was not part of original test case, I have updated.
* @run main/othervm/manual -Djava.security.manager=allow SecurityDialogTest | ||
* @library /java/awt/regtesthelpers | ||
* @build PassFailJFrame | ||
* @run main/manual/othervm -Djava.security.manager=allow SecurityDialogTest | ||
*/ |
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.
Line spacing here would be nice.
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.
@TejeshR13 What do you mean? What kind of line spacing would be nice here?
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.
Line spacing between JTREG tag and class.
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's not needed… but most people add it. And we cannot agree on a common style, unfortunately.
These jtreg tags are akin to javadoc comment (but they're not javadoc comment, and javadoc syntax /**
with double-asterisk should not be used), and in most cases the javadoc comment is not separated with a blank line from its class.
The last line of the jtreg tags comment is nearly empty by itself.
"to be disabled if there is no read/write file permission.", | ||
"You should test this by trying different policy files." | ||
}; | ||
PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() |
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.
I am getting an error for using new PassFailJFrame passFailJFrame = new PassFailJFrame.Builder()
, stating "'Builder()' has private access in 'PassFailJFrame.Builder'" Probably because I have fetched latest PassFailJFrame.
And also you can use PassFailJFrame.builder()
method.
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.
For me its building and running properly
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, might be an issue from my side. Will look into it.
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.
I am getting an error for using
new PassFailJFrame passFailJFrame = new PassFailJFrame.Builder()
, stating "'Builder()' has private access in 'PassFailJFrame.Builder'". Probably because I have fetched latestPassFailJFrame
.
@TejeshR13 You're absolutely right. Thanks for catching it.
And also you can use
PassFailJFrame.builder()
method.
Not can but must.
The test won't work after it's integrated, it won't compile.
*/ | ||
public class SecurityDialogTest extends Frame { |
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.
public class SecurityDialogTest extends Frame { | |
public class SecurityDialogTest { |
It does not need to extend Frame
.
*/ | ||
public class SecurityDialogTest extends Frame { | ||
private static final String INSTRUCTIONS = |
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.
INSTRUCTIONS can be moved inside main.
No. Well, it can but what's the point?
I find a value in having the instructions as a dedicated constant at the top of the file. When you open the test, the instructions will be the first thing you see, and it's what you need after reading the summary in @summary
tag above the class declaration.
"to be disabled if there is no read/write file permission.", | ||
"You should test this by trying different policy files." | ||
}; | ||
PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() |
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.
I am getting an error for using
new PassFailJFrame passFailJFrame = new PassFailJFrame.Builder()
, stating "'Builder()' has private access in 'PassFailJFrame.Builder'". Probably because I have fetched latestPassFailJFrame
.
@TejeshR13 You're absolutely right. Thanks for catching it.
And also you can use
PassFailJFrame.builder()
method.
Not can but must.
The test won't work after it's integrated, it won't compile.
IDE never suggests converting constants to local variables. It is because constants can be inlined by Java compiler. Static or instance fields as well as local variables are usually kept. Converting a field to local variable reduces the size of the object. |
* @summary tests native and cross-platform page and print dialog | ||
* when security manager is installed |
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.
Verifies "Print to file" option is disable if reading/writing files is not allowed by Security Manager.
I believe this type of summary explains better the purpose of the test, and the purpose is to ensure "Print to file" is disabled in writing to files is not allowed, according to the instructions of in the test.
@@ -64,7 +66,7 @@ public static void main(String[] args) throws Exception { | |||
throw new RuntimeException("Printer not configured or available."); | |||
} | |||
|
|||
PassFailJFrame passFailJFrame = new PassFailJFrame.Builder() | |||
PassFailJFrame passFailJFrame = PassFailJFrame.builder() |
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.
PassFailJFrame passFailJFrame = PassFailJFrame.builder() | |
PassFailJFrame passFailJFrame = PassFailJFrame.builder() |
Removed redundant double space.
/integrate |
@Renjithkannath |
/sponsor |
Going to push as commit 9f5ad43.
Your commit was automatically rebased without conflicts. |
@TejeshR13 @Renjithkannath Pushed as commit 9f5ad43. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi Reviewers,
I have updated the test with PassFailJFrame with information panel, earlier this was informed through terminal.
Please review and let me know your suggestions if any.
Progress
Issue
Reviewers
Contributors
<aivanov@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18299/head:pull/18299
$ git checkout pull/18299
Update a local copy of the PR:
$ git checkout pull/18299
$ git pull https://git.openjdk.org/jdk.git pull/18299/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18299
View PR using the GUI difftool:
$ git pr show -t 18299
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18299.diff
Webrev
Link to Webrev Comment