Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255080

SwingNodeJDialogTest fails to match exact color on some macOS systems

XMLWordPrintable

      I get the following test failure consistently on a relatively new MacBook Pro system (early 2020 model), running macOS 10.15.7.

      SwingNodeJDialogTest

      test.robot.javafx.embed.swing.SwingNodeJDialogTest > testJDialogAbove FAILED
          java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
              at org.junit.Assert.fail(Assert.java:91)
              at org.junit.Assert.failNotEquals(Assert.java:645)
              at org.junit.Assert.assertEquals(Assert.java:126)
              at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
              at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testJDialogAbove(SwingNodeJDialogTest.java:42)

      test.robot.javafx.embed.swing.SwingNodeJDialogTest > testNodeRemovalAfterShow FAILED
          java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
              at org.junit.Assert.fail(Assert.java:91)
              at org.junit.Assert.failNotEquals(Assert.java:645)
              at org.junit.Assert.assertEquals(Assert.java:126)
              at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
              at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testNodeRemovalAfterShow(SwingNodeJDialogTest.java:52)

      test.robot.javafx.embed.swing.SwingNodeJDialogTest > testStageCloseAfterShow FAILED
          java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
              at org.junit.Assert.fail(Assert.java:91)
              at org.junit.Assert.failNotEquals(Assert.java:645)
              at org.junit.Assert.assertEquals(Assert.java:126)
              at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
              at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testStageCloseAfterShow(SwingNodeJDialogTest.java:77)

      test.robot.javafx.embed.swing.SwingNodeJDialogTest > testStageCloseBeforeShow FAILED
          java.lang.AssertionError: JDialog is not above JavaFX stage expected:<java.awt.Color[r=0,g=0,b=255]> but was:<java.awt.Color[r=20,g=0,b=255]>
              at org.junit.Assert.fail(Assert.java:91)
              at org.junit.Assert.failNotEquals(Assert.java:645)
              at org.junit.Assert.assertEquals(Assert.java:126)
              at test.robot.javafx.embed.swing.SwingNodeBase.testAbove(SwingNodeBase.java:218)
              at test.robot.javafx.embed.swing.SwingNodeJDialogTest.testStageCloseBeforeShow(SwingNodeJDialogTest.java:87)

      I suspect some sort of difference in the color profile on that system (in which case this might be closed as not a bug), but will need to check. If not, then we will need to add tolerance to the color check of that test. I note that this particular test uses AWT Robot rather than FX Robot.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: