Package org.codehaus.dna.impl

Examples of org.codehaus.dna.impl.DefaultConfiguration


    public void testSerializeElementWithNoContentOrChildren()
        throws Exception
    {
        final String name = "element";
        final DefaultConfiguration configuration = new DefaultConfiguration( name, "", "" );
        final SAXConfigurationSerializer serializer = new MockSAXConfigurationSerializer();

        final MockInvocationRecorder recorder = new MockInvocationRecorder();
        recorder.addInvocation( SAXMethods.START_ELEMENT,
                                new Object[]{"", name, name,
View Full Code Here


    public void testSerializeElementWithValue()
        throws Exception
    {
        final String name = "element";
        final String value = "value";
        final DefaultConfiguration configuration = new DefaultConfiguration( name, "", "" );
        configuration.setValue( value );
        final SAXConfigurationSerializer serializer = new MockSAXConfigurationSerializer();

        final MockInvocationRecorder recorder = new MockInvocationRecorder();
        recorder.addInvocation( SAXMethods.START_ELEMENT,
                                new Object[]{"", name, name,
View Full Code Here

    public void testSerializeElementWithChild()
        throws Exception
    {
        final String name = "element";
        final String childName = "child";
        final DefaultConfiguration configuration = new DefaultConfiguration( name, "", "" );
        final DefaultConfiguration child = new DefaultConfiguration( childName, "", "" );
        configuration.addChild( child );
        final SAXConfigurationSerializer serializer = new MockSAXConfigurationSerializer();

        final MockInvocationRecorder recorder = new MockInvocationRecorder();
        recorder.addInvocation( SAXMethods.START_ELEMENT,
View Full Code Here

        throws Exception
    {
        final String name = "element";
        final String childName = "child";
        final String value = "text";
        final DefaultConfiguration configuration = new DefaultConfiguration( name, "", "" );
        final DefaultConfiguration child = new DefaultConfiguration( childName, "", "" );
        configuration.addChild( child );
        child.setValue( value );
        final SAXConfigurationSerializer serializer = new MockSAXConfigurationSerializer();

        final MockInvocationRecorder recorder = new MockInvocationRecorder();
        recorder.addInvocation( SAXMethods.START_ELEMENT,
                                new Object[]{"", name, name,
View Full Code Here

    public void testSerializeElementAsPartOfDocument()
        throws Exception
    {
        final String name = "element";
        final DefaultConfiguration configuration = new DefaultConfiguration( name, "", "" );
        final SAXConfigurationSerializer serializer = new MockSAXConfigurationSerializer();

        final MockInvocationRecorder recorder = new MockInvocationRecorder();
        recorder.addInvocation( SAXMethods.START_DOCUMENT,
                                new Object[ 0 ],
View Full Code Here

    public void testConfigureOnComponentImplementingStage()
        throws Exception
    {
        final MockComponent object = new MockComponent();
        final DefaultConfiguration resource = new DefaultConfiguration( "s", "", "" );

        ContainerUtil.configure( object, resource );

        assertEquals( resource, object.getConfiguration() );
    }
View Full Code Here

    public void testConfigureOnComponentImplementingStageButNullLogger()
        throws Exception
    {
        final MockComponent object = new MockComponent();
        final DefaultConfiguration resource = null;

        try
        {
            ContainerUtil.configure( object, resource );
        }
View Full Code Here

        throws Exception
    {
        final String name = "myElement";
        final String location = "file.xml:20";
        final String path = "";
        final DefaultConfiguration configuration =
            new DefaultConfiguration( name, location, path );
        assertEquals( "name", name, configuration.getName() );
        assertEquals( "location", location, configuration.getLocation() );
        assertEquals( "path", path, configuration.getPath() );
    }
View Full Code Here

        final String name = null;
        final String location = "file.xml:20";
        final String path = "";
        try
        {
            new DefaultConfiguration( name, location, path );
        }
        catch( final NullPointerException npe )
        {
            assertEquals( "name", npe.getMessage() );
            return;
View Full Code Here

        final String name = "name";
        final String location = null;
        final String path = "";
        try
        {
            new DefaultConfiguration( name, location, path );
        }
        catch( final NullPointerException npe )
        {
            assertEquals( "location", npe.getMessage() );
            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.