Package org.codehaus.metaclass.model

Examples of org.codehaus.metaclass.model.Attribute


     * @throws java.lang.Exception if an error occurs
     */
    public void verifyType( final String name, final Class type )
        throws Exception
    {
        final Attribute attribute =
            Attributes.getAttribute( type, "dna.component" );
        if( null == attribute )
        {
            final String msg = "Legacy? component " + name
                + " does not specify correct metadata. Skipping type verification";
View Full Code Here


{
    public void testProcessClassAttributeWithoutTransformations()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "ignored" );
        final Attribute result =
            interceptor.processClassAttribute(
                new JavaClass( new JavaSource() ),
                attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "ignored", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      0,
                      result.getParameterCount() );
    }
View Full Code Here

    public void testProcessClassAttributeWithPhoenixBlock()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "phoenix:block" );
        final Attribute result =
            interceptor.processClassAttribute(
                new JavaClass( new JavaSource() ),
                attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.component", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      0,
                      result.getParameterCount() );
    }
View Full Code Here

        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "name", "MyTopic" );
        final Attribute attribute = new Attribute( "phoenix:mx-topic",
                                                   parameters );
        final Attribute result =
            interceptor.processClassAttribute(
                new JavaClass( new JavaSource() ),
                attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.component", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
                      result.getParameterCount() );
        assertEquals( "attribute.parameter(description)",
                      "MyTopic",
                      result.getParameter( "description" ) );
    }
View Full Code Here

        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "name", "X" );
        final Attribute attribute = new Attribute( "phoenix:service",
                                                   parameters );
        final Attribute result =
            interceptor.processClassAttribute(
                new JavaClass( new JavaSource() ),
                attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.service", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
                      result.getParameterCount() );
        assertEquals( "attribute.parameter(type)",
                      "X",
                      result.getParameter( "type" ) );
    }
View Full Code Here

        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "class", "X" );
        final Attribute attribute = new Attribute( "phoenix:mx-proxy",
                                                   parameters );
        final Attribute result =
            interceptor.processClassAttribute(
                new JavaClass( new JavaSource() ),
                attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.proxy", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
                      result.getParameterCount() );
        assertEquals( "attribute.parameter(type)",
                      "X",
                      result.getParameter( "type" ) );
    }
View Full Code Here

    public void testProcessMethodAttributeWithoutTransformation()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "ignore-me" );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "ignore-me", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      0,
                      result.getParameterCount() );
    }
View Full Code Here

    public void testProcessMethodAttributeWithMXDescription()
        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "phoenix:mx-description" );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNull( "attribute", result );
    }
View Full Code Here

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

    public void testProcessMethodAttributeWithMXAttributeAndDescription()
        throws Exception
    {
        final String description = "A Random Thought";
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute( "phoenix:mx-attribute" );
        final JavaMethod method = new JavaMethod();
        final ArrayList tags = new ArrayList();
        final DocletTagFactory factory = new DefaultDocletTagFactory();
        tags.add(
            factory.createDocletTag( "phoenix:mx-description", description ) );
        method.setTags( tags );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.attribute", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      1,
                      result.getParameterCount() );
        assertEquals( "attribute.parameter(description)",
                      description, result.getParameter( "description" ) );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.metaclass.model.Attribute

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.