Examples of DNAAttributeInterceptor


Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testProcessConfigurationAttributeWithoutLocationOrType()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();

        final MockJavaClass clazz = new MockJavaClass();
        clazz.setName( "Blah" );

        final Attribute attribute = new Attribute( "dna.configuration" );
        final Attribute result =
            interceptor.processConfigurationAttribute( clazz, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.configuration", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount", 1, result.getParameterCount() );
        assertEquals( "attribute.parameter(location)",
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testProcessConfigurationAttributeWithLocation()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();

        final MockJavaClass clazz = new MockJavaClass();
        clazz.setName( "Blah" );

        final Properties parameters = new Properties();
        parameters.setProperty( "location", "Meep.xml" );
        final Attribute attribute = new Attribute( "dna.configuration", parameters );
        final Attribute result =
            interceptor.processConfigurationAttribute( clazz, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.configuration", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount", 1, result.getParameterCount() );
        assertEquals( "attribute.parameter(location)",
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testProcessConfigurationAttributeWithType()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();

        final MockJavaClass clazz = new MockJavaClass();
        clazz.setName( "Blah" );

        final Properties parameters = new Properties();
        parameters.setProperty( "type", "MeepSchemaLanguage" );
        final Attribute attribute = new Attribute( "dna.configuration", parameters );
        final Attribute result =
            interceptor.processConfigurationAttribute( clazz, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.configuration", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount", 2, result.getParameterCount() );
        assertEquals( "attribute.parameter(location)",
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testDetermineKeyWhenNothingSpecified()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Properties parameters = new Properties();
        final Attribute attribute = new Attribute( "dna.dependency", parameters );
        final String key = interceptor.determineKey( attribute, "com.biz.Foo" );
        assertEquals( "key", "com.biz.Foo", key );
    }
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testDetermineKeyWhenQualifierSpecified()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "qualifier", "x" );
        final Attribute attribute = new Attribute( "dna.dependency", parameters );
        final String key = interceptor.determineKey( attribute, "com.biz.Foo" );
        assertEquals( "key", "com.biz.Foo/x", key );
    }
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testDetermineKeyWhenKeySpecified()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "key", "x" );
        final Attribute attribute = new Attribute( "dna.dependency", parameters );
        final String key = interceptor.determineKey( attribute, "com.biz.Foo" );
        assertEquals( "key", "x", key );
    }
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testGetSchemaLocationForClassInDefaultPackage()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final String location = interceptor.getSchemaLocationFor( "Foo" );
        assertEquals( "location", "Foo-schema.xml", location );
    }
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testGetSchemaLocationForClassInNonDefaultPackage()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final String location = interceptor.getSchemaLocationFor( "com.biz.Foo" );
        assertEquals( "location", "Foo-schema.xml", location );
    }
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testResolveType()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final String type = interceptor.resolveType( new MockJavaClass(), "X" );
        assertEquals( "type", MockJavaSource.PREFIX + "X", type );
    }
View Full Code Here

Examples of org.codehaus.dna.tools.metaclass.DNAAttributeInterceptor

    }

    public void testResolveTypeOnArray()
        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final String type = interceptor.resolveType( new MockJavaClass(), "X[]" );
        assertEquals( "type", MockJavaSource.PREFIX + "X[]", type );
    }
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.