JDK-8287527 : Test javax/swing/JSlider/TestJSliderRendering.java always fails in 8u
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u331
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • Submitted: 2022-05-30
  • Updated: 2025-04-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8-poolUnresolved
Related Reports
Relates :  
Sub Tasks
JDK-8287529 :  
Description
The javax/swing/JSlider/TestJSliderRendering.java test always fails in 8u since it was backported.

----------messages:(4/141)----------
command: main TestJSliderRendering
reason: User specified action: run main TestJSliderRendering 
Mode: othervm
elapsed time (seconds): 2.483
----------configuration:(0/0)----------
----------System.out:(0/0)----------
----------System.err:(13/785)----------
java.lang.RuntimeException: The slider is not rendered properly
	at TestJSliderRendering.main(TestJSliderRendering.java:140)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.lang.Thread.run(Thread.java:750)

JavaTest Message: Test threw exception: java.lang.RuntimeException: The slider is not rendered properly
JavaTest Message: shutting down test
Comments
I attached the screenshot of the test frame, it looks exactly the same as the frame rendered by JDK 19. It looks like a test bug rather than a product bug. Maybe robot.getPixelColor returns wrong results. Rendering JSlider to a BufferedImage and then analysing the result could be more robust. Alternatively, you can capture an area of the screen with Robot.createScreenCapture and then analyse the result. In case of failure, the image can be saved, which will make failure analysis easier.
30-05-2022