Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 137748 - KeymapViewModelTest.testChangeShortcutsOk fails
KeymapViewModelTest.testChangeShortcutsOk fails
Product: editor
Classification: Unclassified
Component: Key bindings
All All
: P4 (vote)
: 7.0
Assigned To: Svata Dedic
Depends on:
  Show dependency treegraph
Reported: 2008-06-19 17:13 UTC by Jesse Glick
Modified: 2016-07-07 07:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2008-06-19 17:13:49 UTC
Was marked as failing randomly, but in fact fails every time I run it.
Comment 1 Jesse Glick 2008-06-19 17:15:03 UTC
Will comment out until fixed.
Comment 2 Jiri Skrivanek 2008-09-16 08:43:44 UTC
Comment 3 Jiri Skrivanek 2008-09-19 11:07:16 UTC
Still failing.
Comment 4 Jiri Skrivanek 2008-09-19 11:17:48 UTC
I tried to fix
options.keymap/test/unit/src/org/netbeans/modules/options/keymap/ But it
is still failing. Maxi, could you look at it? I don't exactly know what it is supposed to do. model.apply() should store
changed shortcuts but it calls "model = new KeymapModel ();" which resets it. I am lost here. Remember that it fails
only in debugger (toggle breakpoint at line with checkShortcuts) because model.apply() is posted to RequestProcessor.
Comment 5 Quality Engineering 2008-09-20 05:43:59 UTC
Integrated into 'main-golden', will be available in build *200809200201* on (upload may still be in progress)
User: Jiri Skrivanek <>
Log: #137748 - testChangeShortcutsOk still failing.
Comment 6 Max Sauer 2008-09-30 13:34:13 UTC
The "model = new KeymapModel ();" does not break anything, since call to changeKeymap stores everything to looked-up keymapmanagers. Jirko, is it a 
problem that it fails in debugger in described scenerio? Normally, the test passes OK for me. In case not, I suggest to close this issue and leave the test 
as such:

public void testChangeShortcutsOk () {
        KeymapViewModel model = new KeymapViewModel ();
        Map<Set<String>,ShortcutAction> shortcuts = setRandomShortcuts (model);
        System.out.println ("apply changes");
        model.apply ();
        System.gc ();
        model.apply ();
        System.gc ();
        checkShortcuts (model, shortcuts, true);

Comment 7 Jiri Skrivanek 2008-10-01 09:43:57 UTC
The problem is that the test failed randomly and if you run it in debugger it fails regularly. As I said it is because
model.apply() is done in RequestProcessor and in fact it doesn't executed if you just run it. The test itself finishes
before RequestProcessor processes its tasks. To reproduce reliably add something like this to the test:

        model.apply ();
        while(model.isChanged()) {

Then the test fails everytime.
Comment 8 Max Sauer 2008-11-19 14:48:24 UTC
This needs to be redesigned, I agree. apply() w/o RequestProcessor would take ages, so we have to find another way of applying the changes.
Comment 9 Quality Engineering 2012-10-23 12:09:08 UTC
Integrated into 'main-golden', will be available in build *201210231040* on (upload may still be in progress)
User: Milutin Kristofic <>
Log: #137748 - KeymapViewModelTest.testChangeShortcutsOk fails
Comment 10 Milutin Kristofic 2012-10-24 12:00:37 UTC
revert my changes in
Comment 11 Martin Balin 2016-07-07 07:30:49 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo