Package java.util.prefs

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


        assertTrue(p instanceof AbstractPreferences);
        assertEquals("/", p.absolutePath());
        assertSame(null, p.parent());
        assertTrue(p.isUserNode());
        assertEquals("", p.name());
        assertEquals("User Preference Node: " + p.absolutePath(), p.toString());
        // assertEquals(0, p.childrenNames().length);
        // assertEquals(p.keys().length, 0);
    }

    public void testImportPreferences() throws Exception {
View Full Code Here


        }
    }

    public void testAbstractMethods() {
        Preferences p = new MockPreferences();
        p.absolutePath();
        try {
            p.childrenNames();
        } catch (BackingStoreException e4) {
        }
        try {
View Full Code Here

        List list = new ArrayList();
        Preferences preferences = prefs;
        while ((preferences.parent() != null) && (preferences.parent().parent() != null))
        {
            list.add(preferences.absolutePath());
            preferences = preferences.parent();
        }
        return (String[]) list.toArray(new String[0]);
    }
View Full Code Here

        {
            log.debug("Added group preferences node: " + fullPath);
        }
        try
        {
            if ((null != preferences) && preferences.absolutePath().equals(fullPath))
            {
                // Add role principal.
                groupSecurityHandler.setGroupPrincipal(groupPrincipal);
                if (log.isDebugEnabled())
                {
View Full Code Here

        assertEquals("expected role principal full path name == testgetrole", "testgetrole", rolePrincipal.getName());

        // Test the Role Preferences.
        Preferences preferences = role.getPreferences();
        assertEquals("expected role node == /role/testgetrole", SecurityHelper.getPreferencesFullPath(rolePrincipal),
                preferences.absolutePath());

        // Cleanup test.
        try
        {
            rms.removeRole("testgetrole");
View Full Code Here

        {
            log.debug("Added role preferences node: " + fullPath);
        }
        try
        {
            if ((null != preferences) && preferences.absolutePath().equals(fullPath))
            {
                // Add role principal.
                roleSecurityHandler.setRolePrincipal(rolePrincipal);
                if (log.isDebugEnabled())
                {
View Full Code Here

    {
       
        Preferences prefs = Preferences.userRoot();
        if (null != prefs)
        {
            assertTrue("expected user root == '/', " + prefs.absolutePath(), prefs.absolutePath().equals("/"));
        }
        else
        {
            assertTrue("expected user root == '/', " + prefs, false);
        }
View Full Code Here

    {
       
        Preferences prefs = Preferences.userRoot();
        if (null != prefs)
        {
            assertTrue("expected user root == '/', " + prefs.absolutePath(), prefs.absolutePath().equals("/"));
        }
        else
        {
            assertTrue("expected user root == '/', " + prefs, false);
        }
View Full Code Here

    public void testSystemRoot()
    {
        Preferences prefs = Preferences.systemRoot();
        if (null != prefs)
        {
            assertTrue("expected system root == '/', " + prefs.absolutePath(), prefs.absolutePath().equals("/"));
        }
        else
        {
            assertTrue("expected system root == '/', " + prefs, false);
        }
View Full Code Here

    public void testSystemRoot()
    {
        Preferences prefs = Preferences.systemRoot();
        if (null != prefs)
        {
            assertTrue("expected system root == '/', " + prefs.absolutePath(), prefs.absolutePath().equals("/"));
        }
        else
        {
            assertTrue("expected system root == '/', " + prefs, false);
        }
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.