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

JDK-8264454 : Jaxp unit test from open jdk needs to be improved #3274

Closed
wants to merge 4 commits into from

Conversation

mahendrachhipa
Copy link
Member

@mahendrachhipa mahendrachhipa commented Mar 30, 2021


Progress

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

Issue

  • JDK-8264454: Jaxp unit test from open jdk needs to be improved

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3274

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

Using diff file

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

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 30, 2021

👋 Welcome back mahendrachhipa! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 30, 2021

@mahendrachhipa The following label will be automatically applied to this pull request:

  • core-libs

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 core-libs core-libs-dev@openjdk.org rfr Pull request is ready for review labels Mar 30, 2021
@mlbridge
Copy link

mlbridge bot commented Mar 30, 2021

Webrevs

} catch (Exception e) {
e.printStackTrace();
Assert.fail("Exception occured: " + e.getMessage());
runWithAllPerm(() -> Thread.currentThread().setContextClassLoader(null));
Copy link
Member

@JoeWang-Java JoeWang-Java Mar 31, 2021

Choose a reason for hiding this comment

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

To address item 4 (the environment is changed), a note, something like "this test runs in othervm" can be added here or to the summary.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the comment


@Test
public void test1() {
public void testSAXParserFactoryCreationWithDefaultContextClassLoader() {
Copy link
Member

Choose a reason for hiding this comment

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

A shorter name such as testWithDefaultClassLoader would be fine.

@@ -41,27 +42,28 @@
*/
@Listeners({jaxp.library.BasePolicy.class})
public class Bug6723276Test {
private static final String ERR_MSG = "org.apache.xerces.jaxp.SAXParserFactoryImpl not found";
Copy link
Member

Choose a reason for hiding this comment

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

This test currently doesn't verify anything since there's no org.apache.xerces.jaxp.SAXParserFactoryImpl on the classpath. Post JDK 9, such test would require creating a dummy module.

Assert.fail(e.getMessage());
}
}
}

@Test
public void test2() {
public void testSAXParserFactoryCreationWithGivenURLContextClassLoader() {
Copy link
Member

Choose a reason for hiding this comment

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

A shorter name would be testWithURLClassLoader

Assert.assertEquals(calendar.getYear(), 1970);
Assert.assertEquals(calendar.getMonth(), 1);
Assert.assertEquals(calendar.getDay(), 2);
Assert.assertEquals(calendar.getHour(), 0, "hour 24 needs to be treated as hour 0 of next day");
Copy link
Member

Choose a reason for hiding this comment

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

This change has added assertions, but it seems ok.

@@ -56,7 +57,7 @@
private static final String TEST_VALUE_FAIL = "*FAIL*";
Copy link
Member

Choose a reason for hiding this comment

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

I don't see this in the expected values. It, along with the related assertions, may be removed.

if (!TEST_VALUES_LEXICAL[onTestValue + 1].equals(duration.toString())) {
Assert.fail("Duration created with \"" + TEST_VALUES_LEXICAL[onTestValue] + "\" was expected to be \""
+ TEST_VALUES_LEXICAL[onTestValue + 1] + "\" and has the value \"" + duration.toString() + "\"");
if (!expectedLex.equals(duration.toString())) {
Copy link
Member

Choose a reason for hiding this comment

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

Can be changed to assertEquals

Copy link
Member Author

Choose a reason for hiding this comment

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

done

// for now due to a bug
try {
QName xmlSchemaType = duration.getXMLSchemaType();
if (!xmlSchemaType.equals(DatatypeConstants.DURATION_YEARMONTH)) {
Copy link
Member

Choose a reason for hiding this comment

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

Can be changed to assertEquals

+ DatatypeConstants.DURATION_YEARMONTH + "\" and has the value \"" + duration.toString() + "\"");
}
}
} catch (IllegalStateException illegalStateException) {
// TODO; this test really should pass
System.err.println("Please fix this bug that is being ignored, for now: " + illegalStateException.getMessage());
Copy link
Member

Choose a reason for hiding this comment

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

Do we still have such a bug?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, test is still trowing IllegalStateException.

@JoeWang-Java
Copy link
Member

Ok, this is enough of improvement for now. I created a bug to keep track of the ISE case.

@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@mahendrachhipa 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:

8264454: Jaxp unit test from open jdk needs to be improved

Reviewed-by: joehw

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

  • ec599da: 8264633: Add missing logging to PlatformRecording#stop
  • e89542f: 8264352: AArch64: Optimize vector "not/andNot" for NEON and SVE
  • 016db40: 8263907: Specification of CellRendererPane::paintComponent(..Rectangle) should clearly mention which method it delegates the call to
  • 78d1164: 8214455: Relocate CDS archived regions to the top of the G1 heap
  • 88eb291: 8264809: test-lib fails to build due to some warnings in ASN1Formatter and jfr
  • a863ab6: 8264551: Unexpected warning when jpackage creates an exe
  • 6e2b82a: 8264731: Introduce InstanceKlass::method_at_itable_or_null()
  • 22b20f8: 8264424: Support OopStorage bulk allocation
  • ab3be72: 8264863: Update JCov version to support JDK 17
  • 774e5ae: 8264742: member variable _monitor of MonitorLocker is redundant
  • ... and 384 more: https://git.openjdk.java.net/jdk/compare/0ea48d9d65e9c56e6646f799e49337cfd9df676b...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 (@JoeWang-Java) 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 Pull request is ready to be integrated label Apr 8, 2021
@mahendrachhipa
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 8, 2021
@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@mahendrachhipa
Your change (at version 002bdff) is now ready to be sponsored by a Committer.

@JoeWang-Java
Copy link
Member

/sponsor

1 similar comment
@msheppar
Copy link

msheppar commented Apr 8, 2021

/sponsor

@openjdk openjdk bot closed this Apr 8, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 8, 2021
@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@JoeWang-Java @mahendrachhipa Since your change was applied there have been 401 commits pushed to the master branch:

  • 5bd6c74: 8236127: Use value of --icon CLI option to set icon for exe installers
  • 81d35e4: 8264063: Outer Safepoint poll load should not reference the head of inner strip mined loop.
  • 04fa1ed: 8264848: [macos] libjvm.dylib linker warning due to macOS version mismatch
  • 214d6e2: 8263506: Make sun.net.httpserver.UnmodifiableHeaders unmodifiable
  • af13c64: 8264711: More runtime TRAPS cleanups
  • 3aec2d9: 8264718: Shenandoah: enable string deduplication during root scanning
  • 255afbe: 8264672: runtime/ParallelLoad/ParallelSuperTest.java timed out
  • ec599da: 8264633: Add missing logging to PlatformRecording#stop
  • e89542f: 8264352: AArch64: Optimize vector "not/andNot" for NEON and SVE
  • 016db40: 8263907: Specification of CellRendererPane::paintComponent(..Rectangle) should clearly mention which method it delegates the call to
  • ... and 391 more: https://git.openjdk.java.net/jdk/compare/0ea48d9d65e9c56e6646f799e49337cfd9df676b...master

Your commit was automatically rebased without conflicts.

Pushed as commit 308f679.

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

@openjdk
Copy link

openjdk bot commented Apr 8, 2021

@msheppar The command sponsor can only be used in open pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

3 participants