Code example for AbstractPreferences

Methods: addNodeChangeListener, node, removeNodeChangeListener

0
        mncl.assertRemoved(true);
    } 
 
    public void testRemoveNodeChangeListener() throws BackingStoreException, InterruptedException { 
        MockNodeChangeListener mncl = new MockNodeChangeListener();
        parent.addNodeChangeListener(mncl);
        pref.node("test");
        mncl.assertAdded(false);
        mncl.assertRemoved(false);
        parent.removeNodeChangeListener(mncl);
        pref.removeNode();
        mncl.assertAdded(false);
        mncl.assertRemoved(false);
        parent.node("new node");
        mncl.assertAdded(false);
        mncl.assertRemoved(false);
    } 
 
    public void testExportNode() throws BackingStoreException, IOException, InvalidPreferencesFormatException { 
        AbstractPreferences ap = (AbstractPreferences) pref.node("New node");
        pref.putInt("IntValue", 33);