-
Notifications
You must be signed in to change notification settings - Fork 479
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
8339515: [TestBug] Convert web tests to JUnit 5 #1567
Conversation
👋 Welcome back jbhaskar! A progress list of the required criteria for merging this PR into |
@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:
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
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
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.
There is one major issue with the parameterized test as far as I can see. Some minor style guide things, looks good otherwise!
modules/javafx.web/src/test/java/test/com/sun/webkit/network/CookieTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/com/sun/webkit/network/CookieTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/FileReaderTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/LoadTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/LoadTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/SubresourceIntegrityTest.java
Outdated
Show resolved
Hide resolved
Also one note: The copyright year was not updated, but this could also be done by the script afterwards I guess. |
@jaybhaskar this pull request can not be integrated into git checkout testsprint
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 |
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.
You need to revert the copyright year change, since you've mistakenly removed the start year.
modules/javafx.web/src/test/java/test/com/sun/webkit/SharedBufferTest.java
Outdated
Show resolved
Hide resolved
looks like there is a merge conflict label added |
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.
Suggesting a few minor changes.
modules/javafx.web/src/test/java/test/javafx/scene/web/HistoryTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/FormControlsTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/SubresourceIntegrityTest.java
Outdated
Show resolved
Hide resolved
Note to reviewers: The GHA build compiles the web tests, but doesn't run them. Someone will need to do an offline test run with this patch. |
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.
Providing a few comments, majority are related to correcting indentation correction.
- Only space changes: Some indentation changes only add or remove spaces. I would suggest to avoid these changes. Or add only if the existing formatting is very bad. But would recommend to avoid.
- Some indentations are bad, which needs correction for example having
);
on a separate line.
=> I have not pointed out all the indentation corrections. Please do look at other similar changes too.
Another comment is regarding Parameterized test: modules/javafx.web/src/test/java/test/javafx/scene/web/SubresourceIntegrityTest.java
Looks like the test is not converted correctly. The parameters are never assigned to the member variables. Hence never tested. Please take a look at the specific comment on the test. (please check my reply to previous discussion)
modules/javafx.web/src/test/java/test/javafx/scene/web/BindingTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CSSTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CallbackTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CallbackTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CanvasTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CanvasTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CanvasTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/CanvasTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/WebViewTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/test/java/test/javafx/scene/web/SubresourceIntegrityTest.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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 now
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.
- query for old imports produces 0 hits (good)
- left some minor comments, one (assertArrayEquals) might need a code change
assertEquals("/foo", CookieShim.defaultPath(uri("http://hostname/foo/bar"))); | ||
assertEquals("/foo", CookieShim.defaultPath(uri("http://hostname/foo/bar?"))); | ||
assertEquals("/foo", CookieShim.defaultPath(uri("http://hostname/foo/bar?query"))); | ||
assertEquals("/foo", CookieShim.defaultPath(uri("http://hostname/foo/bar?query=push"))); |
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.
minor: just wanted to say these formatting changes are probably unnecessary, and there is an added value of being able to set a breakpoint on the CookieShim method that was lost.
having said that, the changes are ok.
int actualLength = (Integer) obj.getMember("length"); | ||
String message = String.format("File at %s: Expected length %d but got %d", | ||
filePath, expectedLength, actualLength); | ||
assertEquals(expectedLength, actualLength, message); |
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 think all this new code can be replaced by assertArrayEquals
public void testcheckJSPeerTostring() { | ||
final JSObject doc = (JSObject) executeScript("document"); | ||
loadContent("<h1></h1>"); | ||
submit(() -> { | ||
getEngine().executeScript(doc.toString()); | ||
assertThrows(NullPointerException.class, () -> { |
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 think this is not an equivalent change:
before, the tests expected NPE to come from any statement within the test body,
after, it only expects from line 695
I don't know where the NPE actually comes from (probably from execute, so in theory the test might still be correct)
(this comment applies to multiple places)
@@ -150,7 +152,9 @@ public void start() { | |||
submit(obj::start); | |||
// Try accessing the resultObject created in JavaFX Application Thread | |||
// from someother thread. It should throw an exception. | |||
obj.resultObject.toString(); | |||
assertThrows(IllegalStateException.class, () -> { |
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.
on second thought, I think this and the previous changes, even though not technically equivalent, are perfectly fine, in the spirit of the test.
/integrate |
Going to push as commit e81b676.
Your commit was automatically rebased without conflicts. |
@jaybhaskar Pushed as commit e81b676. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Successfully converted web tests from JUnit 4 to JUnit 5, ensuring all tests are fully compliant with the JUnit 5 framework.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1567/head:pull/1567
$ git checkout pull/1567
Update a local copy of the PR:
$ git checkout pull/1567
$ git pull https://git.openjdk.org/jfx.git pull/1567/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1567
View PR using the GUI difftool:
$ git pr show -t 1567
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1567.diff
Webrev
Link to Webrev Comment