Package org.codehaus.dna.impl

Examples of org.codehaus.dna.impl.DefaultConfiguration


    }

    public void testGetValueAsBoolean()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        configuration.setValue( "true" );
        assertEquals( "getValue()", true, configuration.getValueAsBoolean() );
        assertEquals( "getValue('false')", true, configuration.getValueAsBoolean( false ) );
    }
View Full Code Here


    }

    public void testGetNullValueAsBoolean()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        assertEquals( "getValue('false')", false, configuration.getValueAsBoolean( false ) );
        try
        {
            configuration.getValueAsBoolean();
        }
        catch( ConfigurationException e )
        {
            return;
        }
View Full Code Here

    }

    public void testGetValueAsInteger()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        configuration.setValue( "3" );
        assertEquals( "getValue()", 3, configuration.getValueAsInteger() );
        assertEquals( "getValue('1')", 3, configuration.getValueAsInteger( 1 ) );
    }
View Full Code Here

    }

    public void testGetNullValueAsInteger()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        assertEquals( "getValue('1')", 1, configuration.getValueAsInteger( 1 ) );
        try
        {
            configuration.getValueAsInteger();
        }
        catch( ConfigurationException e )
        {
            return;
        }
View Full Code Here

    }

    public void testGetMalformedValueAsInteger()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        configuration.setValue( "malformed" );
        assertEquals( "getValue('1')", 1, configuration.getValueAsInteger( 1 ) );
        try
        {
            configuration.getValueAsInteger();
        }
        catch( ConfigurationException e )
        {
            return;
        }
View Full Code Here

    }

    public void testGetValueAsLong()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        configuration.setValue( "3" );
        assertEquals( "getValue()", 3, configuration.getValueAsLong() );
        assertEquals( "getValue('1')", 3, configuration.getValueAsLong( 1 ) );
    }
View Full Code Here

    }

    public void testGetNullValueAsLong()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        assertEquals( "getValue('1')", 1, configuration.getValueAsLong( 1 ) );
        try
        {
            configuration.getValueAsLong();
        }
        catch( ConfigurationException e )
        {
            return;
        }
View Full Code Here

    }

    public void testGetMalformedValueAsLong()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        configuration.setValue( "malformed" );
        assertEquals( "getValue('1')", 1, configuration.getValueAsLong( 1 ) );
        try
        {
            configuration.getValueAsLong();
        }
        catch( ConfigurationException e )
        {
            return;
        }
View Full Code Here

    }

    public void testGetValueAsFloat()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        configuration.setValue( "3.0" );
        assertTrue( "getValue()", 3.0 == configuration.getValueAsFloat() );
        assertTrue( "getValue('1')", 3.0 == configuration.getValueAsFloat( 1 ) );
    }
View Full Code Here

    }

    public void testGetNullValueAsFloat()
        throws Exception
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( "myElement", "file.xml:20", "" );
        assertTrue( "getValue('1')", 1.0 == configuration.getValueAsFloat( 1 ) );
        try
        {
            configuration.getValueAsFloat();
        }
        catch( ConfigurationException e )
        {
            return;
        }
View Full Code Here

TOP

Related Classes of org.codehaus.dna.impl.DefaultConfiguration

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.