RFR: 8353320: Open source more Swing text tests
Alexey Ivanov
aivanov at openjdk.org
Wed Apr 2 16:28:55 UTC 2025
On Tue, 1 Apr 2025 18:34:22 GMT, Phil Race <prr at openjdk.org> wrote:
> Swing text related tests being moved to open source.
Changes requested by aivanov (Reviewer).
test/jdk/javax/swing/text/html/FrameView/4463014/bug4463014.java line 47:
> 45: static JFrame createUI() {
> 46:
> 47: JFrame frame = new JFrame("bug4463014");
Suggestion:
""";
static JFrame createUI() {
JFrame frame = new JFrame("bug4463014");
Add a blank line to separate the instructions from code.
A blank line as the first line of a method is redundant.
test/jdk/javax/swing/text/html/FrameView/4463014/bug4463014.java line 57:
> 55: jep.setPage(file.toURL());
> 56: } catch (Exception e) {
> 57: }
Suggestion:
} catch (Exception e) {
thrown new RuntimeException(e);
}
The test should fail if an exception occurs.
test/jdk/javax/swing/text/html/FrameView/4463014/frameset.html line 11:
> 9: <FRAME name="main" SRC="frame2.html">
> 10: </FRAMESET>
> 11: </HTML>
A blank line in the end of file?
test/jdk/javax/swing/text/html/HTMLEditorKit/bug4102068.java line 26:
> 24: /* @test
> 25: * @bug 4102068
> 26: * @summary Tests that JTextPane with HTMLEditorKit handles the HEAD tag properly
The summary doesn't match the instructions.
The test verifies if the cursor for text and for hyperlinks can be changed, doesn't it?
test/jdk/javax/swing/text/html/HTMLEditorKit/bug4198022.java line 26:
> 24: /* @test
> 25: * @bug 4198022
> 26: * @summary Tests that JTextPane with HTMLEditorKit handles the HEAD tag properly
The summary doesn't match the instructions.
test/jdk/javax/swing/text/html/HTMLEditorKit/bug4245401.java line 61:
> 59: kit.read(new StringReader(text), doc, 0);
> 60: } catch (Exception e) {
> 61: }
If an exception occurs, the test should fail; the exception shouldn't be *silently* ignored.
-------------
PR Review: https://git.openjdk.org/jdk/pull/24365#pullrequestreview-2736880616
PR Review Comment: https://git.openjdk.org/jdk/pull/24365#discussion_r2025179293
PR Review Comment: https://git.openjdk.org/jdk/pull/24365#discussion_r2025183319
PR Review Comment: https://git.openjdk.org/jdk/pull/24365#discussion_r2025184554
PR Review Comment: https://git.openjdk.org/jdk/pull/24365#discussion_r2025188226
PR Review Comment: https://git.openjdk.org/jdk/pull/24365#discussion_r2025190368
PR Review Comment: https://git.openjdk.org/jdk/pull/24365#discussion_r2025192199
More information about the client-libs-dev
mailing list