Skip to content

8339511: [TestBug] Convert Non parametrized base tests to JUnit 5 #1576

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

Closed
wants to merge 6 commits into from

Conversation

jaybhaskar
Copy link
Member

@jaybhaskar jaybhaskar commented Sep 19, 2024

Successfully converted Non-parametrized base tests to JUnit 5


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)

Issue

  • JDK-8339511: [TestBug] Convert Non parametrized base tests to JUnit 5 (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1576

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1576.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 19, 2024

👋 Welcome back jbhaskar! 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 Sep 19, 2024

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

8339511: [TestBug] Convert Non parametrized base tests to JUnit 5

Reviewed-by: kcr, angorya

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 25 new commits pushed to 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
Copy link

openjdk bot commented Sep 19, 2024

@jaybhaskar this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout basetest
git fetch https://git.openjdk.org/jfx.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict Pull request has merge conflict with target branch rfr Ready for review labels Sep 19, 2024
@mlbridge
Copy link

mlbridge bot commented Sep 19, 2024

Webrevs

@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Sep 19, 2024
Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

I left a few (mostly minor) comments, a few suggestions, and three problems that must be fixed:

  1. You removed a total of 9 tests in three files:

Before: 5538 tests (0 failures, 28 ignored)

After: 5529 tests (0 failures, 28 ignored)

  1. Three of the files that you converted still have some JUnit 4 imports

  2. You missed converting the expected= parameter in the @Test annotation to a convertThrows in VetoableObservableListTest.java.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

One remaining problem with mistakenly removed tests. The rest looks good.

Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

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

looked at each line, double checking:

  • before->beforeEach etc.
  • exception types in assertThrows

Could not run the junit4 query because there are still parameterized tests left.

left a few comments, plus some tests need to be brought back.
otherwise looks good.

@kevinrushforth
Copy link
Member

Could not run the junit4 query because there are still parameterized tests left.

What I did to verify this was to do a grep just on those files that changed:

git diff --name-only master... | xargs grep -n -e "org\.junit" -e "junit\.framework" | grep -v jupiter

So, while this doesn't verify that this PR picked up all classes without parameterized tests, it does confirm that there are no JUnit4 imports left in any of the ones that were converted.

@kevinrushforth
Copy link
Member

I got curious, so I looked for all base test files with junit4 imports, and excluded the ones that have parameterized tests. I see that there are a few:

modules/javafx.base/src/test/java/test/com/sun/javafx/property/adapter/JavaBeanPropertyBuilderHelperTest.java
modules/javafx.base/src/test/java/test/javafx/beans/property/adapter/JavaBeanPropertyTestBase.java
modules/javafx.base/src/test/java/test/javafx/beans/value/ObservableValueSubscriptionsTest.java
modules/javafx.base/src/test/java/test/javafx/binding/When_Boolean_Test.java
modules/javafx.base/src/test/java/test/javafx/binding/When_Double_Test.java
modules/javafx.base/src/test/java/test/javafx/binding/When_Float_Test.java
modules/javafx.base/src/test/java/test/javafx/binding/When_Integer_Test.java
modules/javafx.base/src/test/java/test/javafx/binding/When_Long_Test.java
modules/javafx.base/src/test/java/test/javafx/binding/When_Object_Test.java
modules/javafx.base/src/test/java/test/javafx/binding/When_String_Test.java
modules/javafx.base/src/test/java/test/javafx/util/converter/CurrencyStringConverterTest.java
modules/javafx.base/src/test/java/test/javafx/util/converter/NumberStringConverterTest.java

So they can either be added to this PR (if there is nothing else that makes them tricky to convert) or lumped in with the parameterized tests and done in the follow-on bug.

@jaybhaskar
Copy link
Member Author

jaybhaskar commented Sep 21, 2024

JavaBeanPropertyBuilderHelperTest

I left those specific files unchanged as they contain multiple assertThrows statements and involve try-catch blocks, which require additional attention for proper conversion. I would like to address these in pull request focused on parameterized tests.

@kevinrushforth
Copy link
Member

Looks good now. Please wait to see if @andy-goryachev-oracle has any more comments.

/reviewers 2

@openjdk openjdk bot added the ready Ready to be integrated label Sep 21, 2024
@openjdk
Copy link

openjdk bot commented Sep 21, 2024

@kevinrushforth
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).

@openjdk openjdk bot removed the ready Ready to be integrated label Sep 21, 2024
Copy link
Contributor

@andy-goryachev-oracle andy-goryachev-oracle left a comment

Choose a reason for hiding this comment

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

thank you for making the changes!
looks good now.

@openjdk openjdk bot added the ready Ready to be integrated label Sep 23, 2024
@jaybhaskar
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 24, 2024

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

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 24, 2024
@openjdk openjdk bot closed this Sep 24, 2024
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Sep 24, 2024
@openjdk
Copy link

openjdk bot commented Sep 24, 2024

@jaybhaskar Pushed as commit 5bec3f8.

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

@jaybhaskar jaybhaskar deleted the basetest branch March 21, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants