Package java.util.prefs

Examples of java.util.prefs.BackingStoreException


    /*
     * Class under test for void BackingStoreException(Throwable)
     */
    public void testBackingStoreExceptionThrowable() {
        Throwable t = new Throwable("msg");
        BackingStoreException e = new BackingStoreException(t);
        assertTrue(e.getMessage().indexOf(t.getClass().getName()) >= 0);
        assertTrue(e.getMessage().indexOf("msg") >= 0);
        assertEquals(t, e.getCause());
    }
View Full Code Here


    /**
     * @tests serialization/deserialization.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new BackingStoreException("msg"));
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new BackingStoreException("msg"));
    }
View Full Code Here

    private void checkException() throws BackingStoreException {
        switch (result) {
        case NORMAL:
            return;
        case backingException:
            throw new BackingStoreException("test");
        case runtimeException:
            throw new MockRuntimeException("test");
        }
    }
View Full Code Here

    protected void flushSpi() throws BackingStoreException
    {
        if ( ctx == null )
        {
            throw new BackingStoreException( "Ldap context not available for " + super.absolutePath() );
        }


        if ( changes.isEmpty() )
        {
            return;
        }

        try
        {
            ctx.modifyAttributes( "", ( ModificationItem[] ) changes.toArray( EMPTY_MODS ) );
        }
        catch ( NamingException e )
        {
            throw new BackingStoreException( e );
        }

        changes.clear();

        keyToChange.clear();
View Full Code Here

        {
            ctx.destroySubcontext( "" );
        }
        catch ( NamingException e )
        {
            throw new BackingStoreException( e );
        }

        ctx = null;

        changes.clear();
View Full Code Here

    protected void syncSpi() throws BackingStoreException
    {
        if ( ctx == null )
        {
            throw new BackingStoreException( "Ldap context not available for " + super.absolutePath() );
        }


        if ( changes.isEmpty() )
        {
            return;
        }

        try
        {
            ctx.modifyAttributes( "", ( ModificationItem[] ) changes.toArray( EMPTY_MODS ) );
        }
        catch ( NamingException e )
        {
            throw new BackingStoreException( e );
        }

        changes.clear();

        keyToChange.clear();
View Full Code Here

                children.add( ncp.getName() );
            }
        }
        catch ( NamingException e )
        {
            throw new BackingStoreException( e );
        }

        return ( String[] ) children.toArray( EMPTY_STRINGS );
    }
View Full Code Here

                keys.add( id );
            }
        }
        catch ( NamingException e )
        {
            throw new BackingStoreException( e );
        }

        return ( String[] ) keys.toArray( EMPTY_STRINGS );
    }
View Full Code Here

            array[index] = 1;
        }
        try {
            putByteArray(key, array);
        } catch (IllegalArgumentException exc) {
            throw new BackingStoreException(exc);
        }
    }
View Full Code Here

TOP

Related Classes of java.util.prefs.BackingStoreException

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.