Skip to content
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

8270312: Error: Not a test or directory containing tests: java/awt/print/PrinterJob/XparColor.java #4769

Closed
wants to merge 7 commits into from

Conversation

@lawrence-andrew
Copy link
Contributor

@lawrence-andrew lawrence-andrew commented Jul 13, 2021

  1. This testcase was throwing error saying Error: Not a test or directory containing tests: java/awt/print/PrinterJob/XparColor.java
  2. Added @test tag so that this testcase can be run
  3. Since Applet is deprecated and its not supported any more in the future release remove applet and make the testcase to run as main
  4. Since this is a manual testcase instruction frame or dailog was not visible just print dialog was visible so fixed it.
  5. When the testcase was run via main method two print dialog was shown one was from main method and one more was from constructor. Fixed to show just one print dialog.
  6. Since JDK 17 introduce metal rendering touching the java2d code thought this testcase will be useful to checking the rendering.

@shurymury


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8270312: Error: Not a test or directory containing tests: java/awt/print/PrinterJob/XparColor.java

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4769/head:pull/4769
$ git checkout pull/4769

Update a local copy of the PR:
$ git checkout pull/4769
$ git pull https://git.openjdk.java.net/jdk pull/4769/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4769

View PR using the GUI difftool:
$ git pr show -t 4769

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4769.diff

@bridgekeeper bridgekeeper bot added the oca label Jul 13, 2021
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jul 13, 2021

Hi @lawrence-andrew, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user lawrence-andrew" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Jul 13, 2021

@lawrence-andrew The following label will be automatically applied to this pull request:

  • awt

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.

@openjdk openjdk bot added the awt label Jul 13, 2021
@bridgekeeper bridgekeeper bot removed the oca label Jul 15, 2021
@openjdk openjdk bot added the rfr label Jul 15, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 15, 2021

Copy link
Contributor

@prsadhuk prsadhuk left a comment

I guess for applet/manual=yesno cases, it was decided not to tackle individual tests but to use some standard machinery for all such tests..Not sure if such idea has been dropped
May @prrace can throw some idea.

Otherwise it looks good...BTW, it does not timeout and hangs infinitely if left alone..it should timeout after sometime..did you check that case...
You can modify the copyright year too..

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Jul 15, 2021

@prsadhuk , thanks for reviewing the test case. Yes, I checked for timeout tag but when I went though the jtreg documentation https://openjdk.java.net/jtreg/tag-spec.html under /manual[=(yesno|done)] found that we cannot add both /manual and /timeout together . According to the documentation "The /manual option may not be given in conjunction with the /timeout option." I even tried an run the test case and got the following error so decided not to add timeout.
execStatus=Error. Parse Exception: /manual' disables use of /timeout'

@jayathirthrao
Copy link
Member

@jayathirthrao jayathirthrao commented Aug 3, 2021

Since you mentioned about using metal rendering path to verify things. We need to pass -Dsun.java2d.metal=true as of now to run this test case using metal. We can add additional @run with metal enabled for this use case.

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 4, 2021

Now this test will be executed both on metal and opengl

@openjdk openjdk bot removed the rfr label Aug 4, 2021
@openjdk openjdk bot added the rfr label Aug 6, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 10, 2021

@lawrence-andrew 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:

8270312: Error: Not a test or directory containing tests: java/awt/print/PrinterJob/XparColor.java

Reviewed-by: psadhukhan, jdv

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 392 new commits pushed to the master branch:

  • d06d0b9: 8272112: Arena code simplifications
  • 0c4be76: 8058704: Nimbus does not honor JTextPane background color
  • 020aec5: 8271366: [REDO] JDK-8266054 VectorAPI rotate operation optimization
  • 4d4ba5c: 8272116: Update PerfDisableSharedMem with FLAG_SET_ERGO in PerfMemory::create_memory_region
  • 09ab86b: 8269909: getStack method in hprof.parser.Reader should use try-with-resource
  • e4766ee: 8272391: Undeleted debug information
  • 428d516: 8140241: (fc) Data transfer from FileChannel to itself causes hang in case of overlap
  • 93cab7d: 8272315: Improve assert_different_registers
  • 9980b41: 8272107: Removal of Unsafe::defineAnonymousClass left a dangling C++ class
  • 464e874: 8048190: NoClassDefFoundError omits original ExceptionInInitializerError
  • ... and 382 more: https://git.openjdk.java.net/jdk/compare/92ae6a512340485f75a12479dc1c1b8d3261bc76...master

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 (@prsadhuk, @jayathirthrao) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Aug 10, 2021
@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 10, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 10, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 10, 2021

@lawrence-andrew
Your change (at version fe4dc73) is now ready to be sponsored by a Committer.

//Timed out, so fail the test
throw new RuntimeException("Timed out after " + sleepTime / 1000 + " seconds");
} catch (InterruptedException e) {
if (!testGeneratedInterrupt) throw e;
Copy link
Contributor

@prsadhuk prsadhuk Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess timeout code is there here but for somehow it is not working as expected..Could you check?
Otherwise there are other ways of handling user interaction done in
java/awt/print/PrinterJob/BannerTest.java
java/awt/print/PrinterJob/TestSaveFileWithoutPrinter.java

@openjdk openjdk bot removed the sponsor label Aug 11, 2021
@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 11, 2021

Rewrote the code so that test can be started after pressing startTest button and now timeout is taken care.

}

private static void createAndShowTestDialog() {
String testInstruction = "This testcase will be launched twice, once for opengl and once for metal.\n" +
Copy link
Contributor

@prsadhuk prsadhuk Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is supposed to be run in all platforms, not only in mac. Since the default pipeline is not opengl in non-mac platform and also metal is not supported in non-mac platform, so this test instruction that it will run in opengl and metal is wrong in non-mac platform.
You probably need to modify to say it will be run in default pipeline for a particular platform and metal and subsequently check if the platform is non-mac and bail out if metal=true system property is set and inform user that metal cannot be run in present non-mac platform

Copy link
Contributor Author

@lawrence-andrew lawrence-andrew Aug 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @prsadhuk, will modify the instruction

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 11, 2021

Fixed test instruction & add changes to execute the testcase on mac with default and metal pipeline and for non mac execute the testcase with default pipeline.


private static void createAndShowTestDialog() {
String testInstruction = "This testcase will be launched twice on mac platform and once on non mac platform.\n" +
"On Mac once with default pipeline and once again with Metal pipeline.\n" +
Copy link
Contributor

@prsadhuk prsadhuk Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be better to rephrase this line with "This test will be run with default pipeline in all OS and additionally with metal pipeline only in macOS"

Copy link
Contributor

@prsadhuk prsadhuk Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although I am not sure why it is important to run in metal pipeline. I don't think metal has any effect on printing par se.

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 12, 2021

Removed running the testcase in metal pipeline and corrected the instruction as per above comments.

failButton.setEnabled(false);
failButton.addActionListener((e) -> {
dialog.dispose();
fail("PrinterException thrown.");
Copy link
Contributor

@prsadhuk prsadhuk Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok now.. Just this minor thing of failure message should be corrected as PrinterException is not actually being thrown when it fails...probably the message should be "transparent ring colors are not printed correctly"

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 12, 2021

Fixed the exception string.

@lawrence-andrew
Copy link
Contributor Author

@lawrence-andrew lawrence-andrew commented Aug 13, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 13, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 13, 2021

@lawrence-andrew
Your change (at version b942754) is now ready to be sponsored by a Committer.

@prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Aug 17, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Aug 17, 2021

Going to push as commit c5c84b8.
Since your change was applied there have been 416 commits pushed to the master branch:

  • df1427b: 8272446: C1: Raw version of UnsafeGet generates load barriers
  • 989f39f: 8272552: mark hotspot runtime/cds tests which ignore external VM flags
  • ee8bf10: 8272327: Shenandoah: Avoid enqueuing duplicate string candidates
  • 3fb1927: 8271227: Missing {@code } in com.sun.source.*
  • a5ad772: 8272342: [TEST_BUG] java/awt/print/PrinterJob/PageDialogMarginTest.java catches all exceptions
  • ae45592: 8272374: doclint should report missing "body" comments
  • b2c272d: 8272305: several hotspot runtime/modules don't check exit codes
  • 8268825: 8272297: FileInputStream should override transferTo() for better performance
  • 3677734: 8271471: [IR Framework] Rare occurrence of "" in PrintIdeal/PrintOptoAssembly can let tests fail
  • 0a03481: 8272231: G1: Refactor G1CardSet::get_card_set to return G1CardSetHashTableValue*
  • ... and 406 more: https://git.openjdk.java.net/jdk/compare/92ae6a512340485f75a12479dc1c1b8d3261bc76...master

Your commit was automatically rebased without conflicts.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 17, 2021

@prsadhuk @lawrence-andrew Pushed as commit c5c84b8.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants