Package org.codehaus.loom.info

Examples of org.codehaus.loom.info.PhoenixAttributeInterceptor


    }

    public void testProcessMethodAttributeWithMXOperationAndNoDescriptionOrComment()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "phoenix:mx-operation" );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.operation", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      0,
View Full Code Here


    public void testProcessMethodAttributeWithMXOperationAndDescription()
        throws Exception
    {
        final String description = "A Random Thought";
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "phoenix:mx-operation" );
        final JavaMethod field = new JavaMethod();
        final ArrayList tags = new ArrayList();
        tags.add(
            new DefaultDocletTag( "phoenix:mx-description", description ) );
        field.setTags( tags );
        final Attribute result =
            interceptor.processMethodAttribute( field, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.operation", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
View Full Code Here

    public void testProcessMethodAttributeWithMXOperationAndComment()
        throws Exception
    {
        final String description = "A Random Thought";
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "phoenix:mx-operation" );
        final JavaMethod field = new JavaMethod();
        field.setComment( description );
        final Attribute result =
            interceptor.processMethodAttribute( field, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.operation", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
View Full Code Here

    }

    public void testProcessMethodAttributeWithPhoenixConfigurationSchema()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute(
            "phoenix:configuration-schema" );
        final JavaClass javaClass = new JavaClass( new JavaSource() );
        javaClass.setName( "com.biz.MyClass" );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( javaClass );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name",
                      "dna.configuration",
                      result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
View Full Code Here

    }

    public void testProcessMethodAttributeWithPhoenixConfigurationSchemaSpecifyingType()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        final String type = "BobbaFett";
        parameters.setProperty( "type", type );
        final Attribute attribute = new Attribute(
            "phoenix:configuration-schema", parameters );
        final JavaClass javaClass = new JavaClass( new JavaSource() );
        javaClass.setName( "com.biz.MyClass" );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( javaClass );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name",
                      "dna.configuration",
                      result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
View Full Code Here

    }

    public void testProcessMethodAttributeWithPhoenixConfigurationSchemaSpecifyingRelaxType()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "type", "relax-ng" );
        final Attribute attribute = new Attribute(
            "phoenix:configuration-schema", parameters );
        final JavaClass javaClass = new JavaClass( new JavaSource() );
        javaClass.setName( "com.biz.MyClass" );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( javaClass );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name",
                      "dna.configuration",
                      result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
View Full Code Here

    }

    public void testProcessMethodAttributeWithPhoenixDependency()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        final String type = "BobbaFett";
        parameters.setProperty( "name", type );
        final Attribute attribute = new Attribute( "phoenix:dependency",
                                                   parameters );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.dependency", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
View Full Code Here

    }

    public void testProcessMethodAttributeWithPhoenixDependencyWithRoleSpecified()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        final String type = "BobbaFett";
        final String key = "myKey";
        parameters.setProperty( "name", type );
        parameters.setProperty( "role", key );
        final Attribute attribute = new Attribute( "phoenix:dependency",
                                                   parameters );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.dependency", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      2,
View Full Code Here

    }

    public void testProcessClassAttributesWithoutMXService()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute[] input = new Attribute[]{
            new Attribute( "RandomJAttribute" )};
        final Attribute[] attributes =
            interceptor.processClassAttributes(
                new JavaClass( new JavaSource() ), input );
        assertEquals( "attributes.length", 1, attributes.length );
        assertEquals( "attributes[0].name",
                      "RandomJAttribute",
                      attributes[ 0 ].getName() );
View Full Code Here

    }

    public void testProcessClassAttributesWithMXService()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        final String type = "PerformMagicService";
        parameters.setProperty( "name", type );
        final Attribute attribute = new Attribute( "phoenix:mx", parameters );
        final Attribute[] input = new Attribute[]{attribute};
        final Attribute[] attributes =
            interceptor.processClassAttributes(
                new JavaClass( new JavaSource() ), input );
        assertEquals( "attributes.length", 2, attributes.length );
        assertEquals( "attributes[0].name",
                      "dna.service",
                      attributes[ 0 ].getName() );
View Full Code Here

TOP

Related Classes of org.codehaus.loom.info.PhoenixAttributeInterceptor

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.