RFR: 8282234: Create a regression test for JDK-4532513 [v5]

Manukumar V S mvs at openjdk.java.net
Mon Mar 7 10:25:59 UTC 2022


> Create a regression test for [JDK-4532513](https://bugs.openjdk.java.net/browse/JDK-4532513).
> This test verifies that the DefaultCaret doesn't requests focus in mouseClick and mousePressed causing the associated input verifier to fire twice.
> As per [JDK-4532513](https://bugs.openjdk.java.net/browse/JDK-4532513), the DefaultCaret requests focus in mouseClick and mousePressed causing the associated input verifier to fire twice.
> This issue was raised in JDK 1.4.0 and fixed in 1.4.1, so the test need to be failed in 1.4.0 and must pass in 1.4.1.
> 
> Testing:
> 
> In JDK 1.4.0:
> $ ./j2sdk1.4.0/bin/java DefaultCaretWin
> Testing L&F: javax.swing.plaf.metal.MetalLookAndFeel
> shouldYieldFocus called 1
> shouldYieldFocus called 2
> shouldYieldFocus called 3
> java.lang.RuntimeException: Test failed for javax.swing.plaf.metal.MetalLookAndFeel as InputVerifier.shouldYieldFocus() getting called 3 times on jTextField2, but it is expected to call only once.
>         at DefaultCaretWin.runTest(DefaultCaretWin.java:114)
>         at DefaultCaretWin.main(DefaultCaretWin.java:58)
> 
> In JDK 1.4.1:
> $ ./j2sdk1.4.1/bin/java DefaultCaretWin
> Testing L&F: javax.swing.plaf.metal.MetalLookAndFeel
> shouldYieldFocus called 1
> Test passed for laf: javax.swing.plaf.metal.MetalLookAndFeel
> Testing L&F: com.sun.java.swing.plaf.motif.MotifLookAndFeel
> shouldYieldFocus called 1
> Test passed for laf: com.sun.java.swing.plaf.motif.MotifLookAndFeel
> Testing L&F: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
> shouldYieldFocus called 1
> Test passed for laf: com.sun.java.swing.plaf.windows.WindowsLookAndFeel

Manukumar V S has updated the pull request incrementally with one additional commit since the last revision:

  Review comments fixed: Removed unwanted blank lines, removed ENTER key press

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7577/files
  - new: https://git.openjdk.java.net/jdk/pull/7577/files/184f0824..095e918a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7577&range=04
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7577&range=03-04

  Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7577.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7577/head:pull/7577

PR: https://git.openjdk.java.net/jdk/pull/7577



More information about the client-libs-dev mailing list