Code example for AbstractPreferences

Methods: addPreferenceChangeListener, getInt, node, putInt

0
        } 
    } 
 
    public void testAddPreferenceChangeListener() throws Exception { 
        MockPreferenceChangeListener mpcl = new MockPreferenceChangeListener();
        parent.addPreferenceChangeListener(mpcl);
        mpcl.assertChanged(false);
        pref.node("new node");
        mpcl.assertChanged(false);
        parent.node("new node");
        mpcl.assertChanged(false);
        parent.putInt("IntValue", 33);
        mpcl.assertChanged(true);
        assertEquals(33, parent.getInt("IntValue", 22));
        mpcl.assertChanged(false);
        assertEquals(22, parent.getInt("Missed Value", 22));
        mpcl.assertChanged(false);
    } 
 
    public void testRemovePreferenceChangeListener() throws Exception { 
        MockPreferenceChangeListener mpcl = new MockPreferenceChangeListener();