Package java.util.prefs

Examples of java.util.prefs.Preferences.removeNode()


            while (it.hasNext()) {
                Preferences pref = it.next();

                try {
                    pref.removeNode();
                }
                catch (BackingStoreException e) {
                }
                catch (IllegalStateException e) {
                    // do nothing
View Full Code Here


            assertEquals(0, p.keys().length);
        } catch (BackingStoreException e) {
            // could be thrown according to specification
        }
        try {
            parent.removeNode();
        } catch (BackingStoreException e) {
            // could be thrown according to specification
        }
        try {
            p = Preferences.userNodeForPackage(null);
View Full Code Here

        assertFalse(p2.isUserNode());

        p2 = new MockAbstractPreferences((AbstractPreferences) Preferences
                .userRoot(), "mock");
        assertNotSame(p2, pref);
        p2.removeNode();
    }

    public void testProtectedFields() throws BackingStoreException {
        if (!(pref instanceof MockAbstractPreferences)) {
            return;
View Full Code Here

                .publicChildSpi("child2"));

        Preferences grandchild = pref.node("child/grandchild");
        assertSame(grandchild, child.childSpi("grandchild"));
        assertSame(grandchild, child.cachedChildrenImpl()[0]);
        grandchild.removeNode();
        assertNotSame(grandchild, pref.node("child/grandchild"));

        grandchild = pref.node("child3/grandchild");
        AbstractPreferences[] childs = ((MockAbstractPreferences) pref)
        .cachedChildrenImpl();
View Full Code Here

        assertFalse(pref.nodeExists("child"));
        Preferences grandchild = pref.node("child/grandchild");
        assertTrue(pref.nodeExists("child"));
        assertTrue(pref.nodeExists("child/grandchild"));
        grandchild.removeNode();
        assertTrue(pref.nodeExists("child"));
        assertFalse(pref.nodeExists("child/grandchild"));
        assertFalse(grandchild.nodeExists(""));

        assertFalse(pref.nodeExists("child2/grandchild"));
View Full Code Here

            Preferences.importPreferences(in);
            prefs = Preferences.userNodeForPackage(PreferencesTest.class);
        } finally {
            try {
                prefs = Preferences.userRoot().node("tests");
                prefs.removeNode();
            } catch (Exception e) {
            }
        }
    }
View Full Code Here

        p.putFloat(null, 1f);
        p.putInt(null, 1);
        p.putLong(null, 1l);
        p.remove(null);
        try {
            p.removeNode();
        } catch (BackingStoreException e2) {
        }
        p.addNodeChangeListener(null);
        p.addPreferenceChangeListener(null);
        p.removeNodeChangeListener(null);
View Full Code Here

                fail("should throw security exception");
            } catch (SecurityException e) {
            }
            try {
                // need FilePermission(delete);
                child1.removeNode();
                fail("should throw security exception");
            } catch (SecurityException e) {
            }
            try {
                uroot.childrenNames();
View Full Code Here

        assertFalse(p2.isUserNode());

        p2 = new MockAbstractPreferences((AbstractPreferences) Preferences
                .userRoot(), "mock");
        assertNotSame(p2, pref);
        p2.removeNode();
    }

    public void testProtectedFields() throws BackingStoreException {
        if (!(pref instanceof MockAbstractPreferences)) {
            return;
View Full Code Here

                .publicChildSpi("child2"));

        Preferences grandchild = pref.node("child/grandchild");
        assertSame(grandchild, child.childSpi("grandchild"));
        assertSame(grandchild, child.cachedChildrenImpl()[0]);
        grandchild.removeNode();
        assertNotSame(grandchild, pref.node("child/grandchild"));

        grandchild = pref.node("child3/grandchild");
        AbstractPreferences[] childs = ((MockAbstractPreferences) pref)
        .cachedChildrenImpl();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.