Package org.codehaus.dna

Examples of org.codehaus.dna.ConfigurationException


    {
        final String message = "myMessage";
        final String path = null;
        final String location = "mylocation.xml:20";
        final Throwable cause = new Throwable();
        final ConfigurationException exception =
            new ConfigurationException( message, path, location, cause );

        assertEquals( "message", message, exception.getMessage() );
        assertEquals( "path", path, exception.getPath() );
        assertEquals( "location", location, exception.getLocation() );
        assertEquals( "cause", cause, exception.getCause() );
    }
View Full Code Here


    {
        final String message = null;
        final String path = "/my/path";
        final String location = "mylocation.xml:20";
        final Throwable cause = new Throwable();
        final ConfigurationException exception =
            new ConfigurationException( message, path, location, cause );

        assertEquals( "message", message, exception.getMessage() );
        assertEquals( "path", path, exception.getPath() );
        assertEquals( "location", location, exception.getLocation() );
        assertEquals( "cause", cause, exception.getCause() );
    }
View Full Code Here

    {
        final String message = "myMessage";
        final String path = "/my/path";
        final String location = null;
        final Throwable cause = new Throwable();
        final ConfigurationException exception =
            new ConfigurationException( message, path, location, cause );

        assertEquals( "message", message, exception.getMessage() );
        assertEquals( "path", path, exception.getPath() );
        assertEquals( "location", location, exception.getLocation() );
        assertEquals( "cause", cause, exception.getCause() );
    }
View Full Code Here

        throws Exception
    {
        final String message = "myMessage";
        final String path = "/my/path";
        final String location = "mylocation.xml:20";
        final ConfigurationException exception =
            new ConfigurationException( message, path, location );

        assertEquals( "message", message, exception.getMessage() );
        assertEquals( "path", path, exception.getPath() );
        assertEquals( "location", location, exception.getLocation() );
        assertEquals( "cause", null, exception.getCause() );
    }
View Full Code Here

    public void testConfigurationExceptionConstructionWith2ArgCtor()
        throws Exception
    {
        final String message = "myMessage";
        final Throwable cause = new Throwable();
        final ConfigurationException exception =
            new ConfigurationException( message, cause );

        assertEquals( "message", message, exception.getMessage() );
        assertEquals( "path", null, exception.getPath() );
        assertEquals( "location", null, exception.getLocation() );
        assertEquals( "cause", cause, exception.getCause() );
    }
View Full Code Here

    public void testConfigurationExceptionToString()
        throws Exception
    {
        final String path = "/my/path";
        final String location = "mylocation.xml:20";
        final ConfigurationException exception =
            new ConfigurationException( "myMessage", path, location );

        final String expected =
            "org.codehaus.dna.ConfigurationException: myMessage" +
            " - " + path +
            " @ " + location;

        assertEquals( expected, exception.toString() );
    }
View Full Code Here

    public void testConfigurationExceptionToStringWithNullPath()
        throws Exception
    {
        final String location = "mylocation.xml:20";
        final ConfigurationException exception =
            new ConfigurationException( "myMessage", null, location );

        final String expected =
            "org.codehaus.dna.ConfigurationException: myMessage" +
            " @ " + location;

        assertEquals( expected, exception.toString() );
    }
View Full Code Here

    public void testConfigurationExceptionToStringWithNullLocation()
        throws Exception
    {
        final String path = "/my/path";
        final ConfigurationException exception =
            new ConfigurationException( "myMessage", path, null );

        final String expected =
            "org.codehaus.dna.ConfigurationException: myMessage" +
            " - " + path;

        assertEquals( expected, exception.toString() );
    }
View Full Code Here

    }

    public void testConfigurationExceptionToStringWithNullLocationAndPath()
        throws Exception
    {
        final ConfigurationException exception =
            new ConfigurationException( "myMessage", null, null );

        final String expected =
            "org.codehaus.dna.ConfigurationException: myMessage";

        assertEquals( expected, exception.toString() );
    }
View Full Code Here

    public void testConfigurationExceptionToStringWithEmptyPath()
        throws Exception
    {
        final String location = "mylocation.xml:20";
        final ConfigurationException exception =
            new ConfigurationException( "myMessage", "", location );

        final String expected =
            "org.codehaus.dna.ConfigurationException: myMessage" +
            " @ " + location;

        assertEquals( expected, exception.toString() );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.dna.ConfigurationException

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.