Code example for AbstractPreferences

Methods: addNodeChangeListener, node

0
        } 
    } 
 
    public void testAddNodeChangeListener() throws Exception { 
        MockNodeChangeListener mncl = new MockNodeChangeListener();
        parent.addNodeChangeListener(mncl);
        pref.node("test");
        mncl.assertAdded(false);
        mncl.assertRemoved(false);
        pref.removeNode();
        mncl.assertAdded(false);
        mncl.assertRemoved(true);
        parent.node("new node");
        mncl.assertAdded(true);
        mncl.assertRemoved(true);
    } 
 
    public void testRemoveNodeChangeListener() throws BackingStoreException, InterruptedException { 
        MockNodeChangeListener mncl = new MockNodeChangeListener();
        parent.addNodeChangeListener(mncl);
        pref.node("test");