Package java.util.prefs

Examples of java.util.prefs.AbstractPreferences$EventDispatcher


        pref.node("child2/grandchild");
        assertTrue(pref.nodeExists("child2/grandchild"));
    }

    public void test_nodeExists() throws BackingStoreException {
        AbstractPreferences test = (AbstractPreferences) Preferences.userRoot()
                .node("test");
        try {
            test.nodeExists(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }

        test.removeNode();
        try {
            test.nodeExists(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }
    }
View Full Code Here


        }
    }

    public void testParent() {
        assertSame(parent, pref.parent());
        AbstractPreferences child1 = new MockAbstractPreferences(pref, "child1");
        assertSame(pref, child1.parent());
        assertNull(root.parent());
    }
View Full Code Here

      checkException();
    } catch (BackingStoreException e) {
    }
    if (result == returnNull)
      return null;
    AbstractPreferences r = childs.get(name);
    if (r == null) {
      r = new MockAbstractPreferences(this, name, true);

    }
    return r;
View Full Code Here

            checkException();
        } catch (BackingStoreException e) {
        }
        if (result == returnNull)
            return null;
        AbstractPreferences r = childs.get(name);
        if (r == null) {
            r = new MockAbstractPreferences(this, name, true);

        }
        return r;
View Full Code Here

        pref.node("child2/grandchild");
        assertTrue(pref.nodeExists("child2/grandchild"));
    }

    public void test_nodeExists() throws BackingStoreException {
        AbstractPreferences test = (AbstractPreferences) Preferences.userRoot()
                .node("test");
        try {
            test.nodeExists(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }

        test.removeNode();
        try {
            test.nodeExists(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }
    }
View Full Code Here

        }
    }

    public void testParent() {
        assertSame(parent, pref.parent());
        AbstractPreferences child1 = new MockAbstractPreferences(pref, "child1");
        assertSame(pref, child1.parent());
        assertNull(root.parent());
    }
View Full Code Here

        assertTrue(pref.nodeExists("child2/grandchild"));
    }

    public void testParent() {
        assertSame(parent, pref.parent());
        AbstractPreferences child1 = new MockAbstractPreferences(pref, "child1");
        assertSame(pref, child1.parent());
        assertNull(root.parent());
    }
View Full Code Here

            checkException();
        } catch (BackingStoreException e) {
        }
        if (result == returnNull)
            return null;
        AbstractPreferences r = childs.get(name);
        if (r == null) {
            r = new MockAbstractPreferences(this, name, true);

        }
        return r;
View Full Code Here

      return children.keySet().toArray(new String[values.size()]);
    }

    @Override
    protected AbstractPreferences childSpi(String name) {
      AbstractPreferences child = children.get(name);
      if (child == null) {
        child = new MockPreferences(this, name);
        children.put(name, child);
      }
      return child;
View Full Code Here

        pref.node("child2/grandchild");
        assertTrue(pref.nodeExists("child2/grandchild"));
    }

    public void test_nodeExists() throws BackingStoreException {
        AbstractPreferences test = (AbstractPreferences) Preferences.userRoot()
                .node("test");
        try {
            test.nodeExists(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }

        test.removeNode();
        try {
            test.nodeExists(null);
            fail("should throw NullPointerException");
        } catch (NullPointerException e) {
            // Expected
        }
    }
View Full Code Here

TOP

Related Classes of java.util.prefs.AbstractPreferences$EventDispatcher

Copyright © 2018 www.massapicom. 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.