JMC-6329: UITest fails due to font changes in MBean Browser

Marcus Hirt marcus.hirt at
Fri Jan 11 20:08:59 UTC 2019

Hi Alex,

The change looks good. Please work with Josh or Mario to push it. 

Kind regards,

On 2019-01-10, 22:42, "jmc-dev on behalf of Marcus Hirt" <jmc-dev-bounces at on behalf of marcus at> wrote:

    Hi Alex,
    The uitests pass with the fix on my Windows system.
    Kind regards,
    -----Ursprungligt meddelande-----
    Från: jmc-dev <jmc-dev-bounces at> För Alex Macdonald
    Skickat: den 10 januari 2019 21:05
    Till: jmc-dev at
    Ämne: RFC: JMC-6329: UITest fails due to font changes in MBean Browser
    This one-liner patch [0] addresses issue JMC-6329 [1], in which a UI test failure occurs when resizing fonts in the MBeanBrowserTabTest [2].
    The test in question is "testValueFontSize()" [3], which essentially verifies that a larger font (size 16) can be resized to a smaller one (e.g., default font) for font height consistency. However, the font size constant used in the test is hardcoded at 11 [4] which is a likely value for many machines, but not all.
    For example, when running the UI tests on my Linux desktop the test passes, because my default font is size 11, but if I run the tests in a virtual display (using something like vncserver), then my default font size is actually 10 and I encounter a test failure that looks like:
    expected:<1|Monospace|11.0|2|GTK|1|> but was:<1|Monospace|10.0|2|GTK|1>
    To address this, I've changed the DEFAULT_FONT_HEIGHT [4] to instead use the actual value of the default font height, retrieved by using JFaceResources.getDefaultFont().getFontData()[0].getHeight(). This change allows the tests to pass on my Linux machines, but I'm interested to see if this will fix the issue on other platforms; the example in the bug report shows that the FontData array differed in two places when run in Windows (one difference in the font height, and another in the font style).

More information about the jmc-dev mailing list