Package org.codehaus.dna.impl

Examples of org.codehaus.dna.impl.DefaultConfiguration


    }

    public void testEqualsWithDifferentAttributeNames()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        configuration1.setAttribute( "key1", "value" );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        configuration2.setAttribute( "key2", "value" );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", false, equal );
    }
View Full Code Here


    }

    public void testEqualsWithDifferentAttributeValues()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        configuration1.setAttribute( "key", "value1" );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        configuration2.setAttribute( "key", "value2" );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", false, equal );
    }
View Full Code Here

    }

    public void testEqualsWithChild()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        final DefaultConfiguration child1 = new DefaultConfiguration( "x", "", "" );
        configuration1.addChild( child1 );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        final DefaultConfiguration child2 = new DefaultConfiguration( "x", "", "" );
        configuration2.addChild( child2 );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", true, equal );
View Full Code Here

    }

    public void testEqualsWithDifferentChildCount()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        final DefaultConfiguration child1 = new DefaultConfiguration( "x", "", "" );
        configuration1.addChild( child1 );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", false, equal );
    }
View Full Code Here

    }

    public void testEqualsWithDifferentChildren()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        final DefaultConfiguration child1 = new DefaultConfiguration( "x", "", "" );
        configuration1.addChild( child1 );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        final DefaultConfiguration child2 = new DefaultConfiguration( "y", "", "" );
        configuration2.addChild( child2 );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", false, equal );
View Full Code Here

    }

    public void testEqualsWithContent()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        configuration1.setValue( "content" );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        configuration2.setValue( "content" );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", true, equal );
    }
View Full Code Here

    }

    public void testEqualsWithDifferentContent()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        configuration1.setValue( "content1" );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        configuration2.setValue( "content2" );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", false, equal );
    }
View Full Code Here

    }

    public void testEqualsWithContentOnOne()
        throws Exception
    {
        final DefaultConfiguration configuration1 = new DefaultConfiguration( "x", "", "" );
        final DefaultConfiguration configuration2 = new DefaultConfiguration( "x", "", "" );
        configuration2.setValue( "content2" );

        final boolean equal =
            ConfigurationUtil.equals( configuration1, configuration2 );
        assertEquals( "config1 == config2", false, equal );
    }
View Full Code Here

    extends TestCase
{
    public void testSerializeZeroLengthAttributes()
        throws Exception
    {
        final DefaultConfiguration configuration = new DefaultConfiguration( "element", "", "" );
        final SAXConfigurationSerializer serializer = new SAXConfigurationSerializer();
        final AttributesImpl attributes = serializer.serializeAttributes( configuration );
        assertEquals( "attributes.getLength()", 0, attributes.getLength() );
    }
View Full Code Here

    }

    public void testSerializeAttributes()
        throws Exception
    {
        final DefaultConfiguration configuration = new DefaultConfiguration( "element", "", "" );
        final String name = "key";
        final String value = "value";
        configuration.setAttribute( name, value );
        final SAXConfigurationSerializer serializer = new SAXConfigurationSerializer();
        final AttributesImpl attributes = serializer.serializeAttributes( configuration );
        assertEquals( "attributes.getLength()", 1, attributes.getLength() );
        assertEquals( "attributes.getLocalName(0)", name, attributes.getLocalName( 0 ) );
        assertEquals( "attributes.getQName(0)", name, attributes.getQName( 0 ) );
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.