Examples of SAXConfigurationHandler


Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testCreateConfigurationWithAttributesWithInterception()
        throws Exception
    {
        final SAXConfigurationHandler handler = new MockSAXConfigurationHandler();
        final String qName = "myElement";
        final AttributesImpl attributes = new AttributesImpl();
        attributes.addAttribute( "", "", "key", "CDATA", "value" );
        handler.startElement( "", "", qName, attributes );
        handler.endElement( "", "", qName );
        final Configuration configuration = handler.getConfiguration();
        assertEquals( "configuration.name", qName, configuration.getName() );
        assertEquals( "configuration.location", "", configuration.getLocation() );
        assertEquals( "configuration.path", "", configuration.getPath() );
        final String[] names = configuration.getAttributeNames();
        assertEquals( "names.length", 1, names.length );
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    extends TestCase
{
    public void testGetLocationWithNullLocator()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final String location = handler.getLocationDescription();
        assertEquals( "location", "", location );
    }
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testGetLocationWithNullSystemId()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        handler.setDocumentLocator( new MockLocator( null ) );
        final String location = handler.getLocationDescription();
        assertEquals( "location", "", location );
    }
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testGetLocationWithNonNullSystemId()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        handler.setDocumentLocator( new MockLocator( "file.xml" ) );
        final String location = handler.getLocationDescription();
        assertEquals( "location", "file.xml", location );
    }
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testGetLocationWithLineSet()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final MockLocator locator = new MockLocator( "file.xml" );
        locator.setLineNumber( 23 );
        handler.setDocumentLocator( locator );
        final String location = handler.getLocationDescription();
        assertEquals( "location", "file.xml:23", location );
    }
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testGetLocationWithColSet()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final MockLocator locator = new MockLocator( "file.xml" );
        locator.setLineNumber( 23 );
        locator.setColumnNumber( 15 );
        handler.setDocumentLocator( locator );
        final String location = handler.getLocationDescription();
        assertEquals( "location", "file.xml:23:15", location );
    }
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testGetLocationWithColSetButLineNotSet()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final MockLocator locator = new MockLocator( "file.xml" );
        locator.setColumnNumber( 15 );
        handler.setDocumentLocator( locator );
        final String location = handler.getLocationDescription();
        assertEquals( "location", "file.xml", location );
    }
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testWarningRethrowsException()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final SAXParseException spe = new SAXParseException( "", null );
        try
        {
            handler.warning( spe );
        }
        catch( final SAXException se )
        {
            assertEquals( spe, se );
            return;
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testErrorRethrowsException()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final SAXParseException spe = new SAXParseException( "", null );
        try
        {
            handler.error( spe );
        }
        catch( final SAXException se )
        {
            assertEquals( spe, se );
            return;
View Full Code Here

Examples of org.codehaus.dna.impl.SAXConfigurationHandler

    }

    public void testFatalRethrowsException()
        throws Exception
    {
        final SAXConfigurationHandler handler = new SAXConfigurationHandler();
        final SAXParseException spe = new SAXParseException( "", null );
        try
        {
            handler.fatalError( spe );
        }
        catch( final SAXException se )
        {
            assertEquals( spe, se );
            return;
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.