Package org.codehaus.dna.impl

Examples of org.codehaus.dna.impl.SAXConfigurationSerializer.serializeAttributes()


    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() );
    }

    public void testSerializeAttributes()
        throws Exception
View Full Code Here


        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 ) );
        assertEquals( "attributes.getURI(0)", "", attributes.getURI( 0 ) );
        assertEquals( "attributes.getType(0)", "CDATA", attributes.getType( 0 ) );
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.