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

7951: Factor out commonly used test helper classes from org.openjdk.jmc.common.test into dedicated test library module #451

Closed
wants to merge 5 commits into from

Conversation

RealCLanger
Copy link
Collaborator

@RealCLanger RealCLanger commented Nov 3, 2022

Triggered by an issue in project core/tests/org.openjdk.jmc.common.test, I came up with a little refactoring.

So, org.openjdk.jmc.common.test is somewhat of a hybrid project. It contains both, some common test scaffolding classes plus some actual tests for the org.openjdk.jmc.common module.

According to our special setup, which is not really like what maven would expect, we have all sources, also for the tests in the src/main/java folder. With a little tweak, that is specifying ${project.basedir}/src/main/java in the pom.xml, we can direct maven to consume the tests from there instead of the usually expected src/test/java subfolder. However, when updating the eclipse project configuration from that pom.xml, the project would not export the test helper classes to other modules within eclipse any more.

I'm hereby factoring out the test helper classes into a new module called core/tests/org.openjdk.jmc.testlib. This module will then only serve as a test helper library but not contain any actual tests.

Furthermore I include some other cleanups in project and manifest files, e.g. removal of .settings files which are .gitignored because they would be generated when importing the JMC projects into Eclipse.


Progress

  • Commit message must refer to an issue
  • Change must be properly reviewed (1 review required, with at least 1 Committer)

Issue

  • JMC-7951: Factor out commonly used test helper classes from org.openjdk.jmc.common.test into dedicated test library module

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jmc pull/451/head:pull/451
$ git checkout pull/451

Update a local copy of the PR:
$ git checkout pull/451
$ git pull https://git.openjdk.org/jmc pull/451/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 451

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jmc/pull/451.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 3, 2022

👋 Welcome back clanger! 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 openjdk bot added the rfr label Nov 3, 2022
@mlbridge
Copy link

mlbridge bot commented Nov 3, 2022

Webrevs

package org.openjdk.jmc.common.test;

import static org.junit.Assert.assertArrayEquals;
package org.openjdk.jmc.test;
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: I think the package name should follow the artifact name, maybe something like :

Suggested change
package org.openjdk.jmc.test;
package org.openjdk.jmc.test.lib;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm, that would be possible but it would render the change a lot larger. There are also subpackages io and mock.item. If we were to rename all 3 packages we'd probably have to touch more tests. So, if we opt to rename the packages I'd prefer to do it in a separate PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I understand the concern.

@thegreystone thegreystone self-requested a review February 22, 2023 20:09
@openjdk
Copy link

openjdk bot commented Feb 22, 2023

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

7951: Factor out commonly used test helper classes from org.openjdk.jmc.common.test into dedicated test library module

Reviewed-by: hirt

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 1 new commit pushed to the master branch:

  • 8eb9115: 8036: Upgrading Jakarta Mail in JMC

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Feb 22, 2023
@RealCLanger
Copy link
Collaborator Author

Thanks for the reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Feb 24, 2023

Going to push as commit 456da39.
Since your change was applied there has been 1 commit pushed to the master branch:

  • 8eb9115: 8036: Upgrading Jakarta Mail in JMC

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated label Feb 24, 2023
@openjdk openjdk bot closed this Feb 24, 2023
@openjdk
Copy link

openjdk bot commented Feb 24, 2023

@RealCLanger Pushed as commit 456da39.

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

@RealCLanger RealCLanger deleted the JMC-7951 branch February 24, 2023 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants