This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 232918 - MenuBarNotInAWTTest.testCreateAndWait test is failing
Summary: MenuBarNotInAWTTest.testCreateAndWait test is failing
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 7.3.1
Hardware: PC Linux
: P2 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2013-07-17 15:13 UTC by Jaroslav Tulach
Modified: 2013-07-31 02:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2013-07-17 15:13:32 UTC
[junit] Testcase: testCreateAndWait(org.openide.awt.MenuBarNotInAWTTest):   FAILED
    [junit] (MenuBarNotInAWTTest.testCreateAndWait marked @RandomlyFails so try just running test again) Created only in AWT
    [junit] junit.framework.AssertionFailedError: (MenuBarNotInAWTTest.testCreateAndWait marked @RandomlyFails so try just running test again) Created only in AWT
    [junit]     at org.openide.awt.MenuBarNotInAWTTest$MyLaF.<init>(MenuBarNotInAWTTest.java:96)
    [junit]     at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    [junit]     at java.lang.Class.newInstance(Class.java:374)
    [junit]     at javax.swing.UIManager.setLookAndFeel(UIManager.java:580)
    [junit]     at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1345)
    [junit]     at javax.swing.UIManager.initialize(UIManager.java:1455)
    [junit]     at javax.swing.UIManager.maybeInitialize(UIManager.java:1422)
    [junit]     at javax.swing.UIManager.getDefaults(UIManager.java:656)
    [junit]     at javax.swing.UIManager.get(UIManager.java:952)
    [junit]     at org.openide.util.ImageUtilities.getImageIconFilter(ImageUtilities.java:181)
    [junit]     at org.openide.util.ImageUtilities.loadImageIcon(ImageUtilities.java:172)
    [junit]     at org.openide.awt.DynaMenuModel.<clinit>(DynaMenuModel.java:73)
    [junit]     at org.openide.awt.MenuBar$MenuBarFolder.<init>(MenuBar.java:358)
    [junit]     at org.openide.awt.MenuBar.startLoading(MenuBar.java:294)
    [junit]     at org.openide.awt.MenuBar.<init>(MenuBar.java:162)
    [junit]     at org.openide.awt.MenuBarNotInAWTTest.testCreateAndWait(MenuBarNotInAWTTest.java:84)
    [junit]     at org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:97)
    [junit]     at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:431)
    [junit]     at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:357)
    [junit]     at java.lang.Thread.run(Thread.java:724)
    [junit] 
    [junit] 
    [junit] Test org.openide.awt.MenuBarNotInAWTTest FAILED
Comment 1 Jaroslav Havlin 2013-07-22 11:44:54 UTC
The test probably fails since commit #1df8daf75020.

Constructor of MenuBar$MenuBarFolder creates a new instance of DynaMenuModel, which initializes its static constant BLANK_ICON.
ImageUtilities.loadImageIcon calls method getImageIconFilter, which calls UIManager.get("nb.imageicon.filter"). So LookAndFeel is initialized outside of the EDT. (It could be a problem, see bug 172277.)

I'm not sure whether the test, ImageUtilities or DynaMenuModel should be fixed.
Please, do you any suggestions?
Comment 2 Stanislav Aubrecht 2013-07-29 13:48:17 UTC
core-main 899f611ff0c8
Comment 3 Quality Engineering 2013-07-31 02:24:29 UTC
Integrated into 'main-silver', will be available in build *201307302300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/899f611ff0c8
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #232918 - failing test