-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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-8294994: Update Jarsigner and Keytool i18n tests to validate i18n compliance #10635
Conversation
👋 Welcome back bhuang! A progress list of the required criteria for merging this PR into |
@bwhuang-us The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
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.
Looks good overall. Some minor suggestions.
/* | ||
* @test | ||
* @bug 4348369 8076069 8294994 | ||
* @summary keytool i18n compliant | ||
* @author charlie lai | ||
* @modules java.base/sun.security.tools.keytool | ||
* @library /test/lib | ||
* @run main/manual/othervm i18n de | ||
*/ | ||
|
||
/* | ||
* @test | ||
* @bug 4348369 8076069 8294994 | ||
* @summary keytool i18n compliant | ||
* @author charlie lai | ||
* @modules java.base/sun.security.tools.keytool | ||
* @library /test/lib | ||
* @run main/manual/othervm i18n ja | ||
*/ | ||
|
||
/* | ||
* @test | ||
* @bug 4348369 8076069 8294994 | ||
* @summary keytool i18n compliant | ||
* @author charlie lai | ||
* @modules java.base/sun.security.tools.keytool | ||
* @library /test/lib | ||
* @run main/manual/othervm i18n zh CN | ||
*/ |
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.
Do you need to triplicate these @test
tags? Would 3-lines of @run
suffice?
Also setting the locale by -Duser.language/country
and getProperty
them in the main would be preferable to passing them as the test case arguments.
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.
Sure, I can make a change to use the system property.
Regarding your first question, a test with multiple 'run' fails and terminates on the first test failure. So I would prefer to have multiple tests rather than multiple 'run' in a single test that it allows jtreg to run all the tests independently.
private volatile boolean aborted = false; | ||
private Thread currentThread = null; | ||
|
||
public static class DialogBuilder { |
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.
This seems to be a boilerplate for displaying the panel. Could this be separated from the test and converted into some library?
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.
Sure, we can move this code to the library as there is no test code in it.
if (args.length == 1) { | ||
Locale.setDefault(Locale.of(args[0])); | ||
} else if (args.length == 2) { | ||
Locale.setDefault(Locale.of(args[0], args[1])); | ||
} |
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 eliminated with the suggestion above.
} else if (args.length == 2) { | ||
Locale.setDefault(Locale.of(args[0], args[1])); | ||
} | ||
final String LANG = Locale.getDefault().getDisplayLanguage(); |
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.
Instead of getDisplayLanguage()
, it should issue getDisplayName()
, as for zh-CN
case, it simply displays Chinese
in the current impl. It's ambiguous whether it is simplified or traditional.
Also, LANG
should be lowercase, as it is not a constant.
I have a question, why must this test be manual? Can't we compare the localized texts? |
Thought about that, but it could be a nuisance if we compared word-to-word translations, considering the situation if an engineer made some changes in the English resource bundle, but l10n may not come at the same time which is guaranteed to fail. |
@wangweij Good question. We can definitely compare the localized texts at least some keywords. The fact that automation is one of the goals of this task. In terms of localization, perhaps in our tests we can reuse the resource bundles implemented in these tools to turn english texts into localized texts. |
Hi @wangweij, I have a discussion with @naotoj about automating this test. Here is a summary.
|
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.
Looks much better now. A minor comment on the library.
test/lib/jdk/test/lib/TestUI.java
Outdated
import java.awt.event.WindowAdapter; | ||
import java.awt.event.WindowEvent; | ||
|
||
public class TestUI { |
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 would expect some class description for this library. Also, could the library name be more descriptive than "TestUI"?
@bwhuang-us 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 47 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 (@naotoj) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@bwhuang-us |
/sponsor |
Going to push as commit ac19414.
Your commit was automatically rebased without conflicts. |
@naotoj @bwhuang-us Pushed as commit ac19414. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The jarsigner and keytool are localized into English, German, Japanese and Simplified Chinese. This task is to modify the existing i18n tests to validate i18n compliance in these tools.
In addition, this task also contains changes for manual test enhancement and simplification which originated from JDK-8292663.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10635/head:pull/10635
$ git checkout pull/10635
Update a local copy of the PR:
$ git checkout pull/10635
$ git pull https://git.openjdk.org/jdk pull/10635/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10635
View PR using the GUI difftool:
$ git pr show -t 10635
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10635.diff