Package org.codehaus.dna.tools.verifier

Examples of org.codehaus.dna.tools.verifier.ComponentVerifier


    }

    public void testVerifyService()
        throws Exception
    {
        final ComponentVerifier verifier = new ComponentVerifier();
        final List issues = new ArrayList();
        verifier.verifyService( ActionListener.class, issues );
        assertNoIssues( issues );
    }
View Full Code Here


    }

    public void testVerifyImplementsServicesThatPasses()
        throws Exception
    {
        final ComponentVerifier verifier = new ComponentVerifier();
        final List issues = new ArrayList();
        final Class[] services = new Class[]{ActionListener.class};
        verifier.verifyImplementsServices( ActionListenerComponent.class, services, issues );
        assertNoIssues( issues );
    }
View Full Code Here

    }

    public void testVerifyImplementsServicesThatNoPasses()
        throws Exception
    {
        final ComponentVerifier verifier = new ComponentVerifier();
        final List issues = new ArrayList();
        final Class[] services = new Class[]{ActionListener.class};
        verifier.verifyImplementsServices( Object.class, services, issues );
        assertSingleIssue( issues, "The metadata declares that the class " +
                                   "supports the service " +
                                   ActionListener.class.getName() +
                                   " but the class does not implement the " +
                                   "service interface.", true, false );
View Full Code Here

    }

    public void testVerifyMetaDataThatPasses()
        throws Exception
    {
        final ComponentVerifier verifier = new ComponentVerifier();
        MetaClassIntrospector.setAccessor( new SimpleAccessor() );
        MetaClassIntrospector.clearCompleteCache();
        final List issues = new ArrayList();
        verifier.verifyMetaData( ComponentVerifierTestCase.class, issues );
        assertNoIssues( issues );
    }
View Full Code Here

    }

    public void testVerifyMetaDataThatNoPasses()
        throws Exception
    {
        final ComponentVerifier verifier = new ComponentVerifier();
        final List issues = new ArrayList();
        MetaClassIntrospector.setAccessor( new NullAccessor() );
        MetaClassIntrospector.clearCompleteCache();
        verifier.verifyMetaData( Object.class, issues );
        assertSingleIssue( issues,
                           "The class does not specify correct " +
                           "metadata. Missing expected dna.component " +
                           "attribute in the class attributes.",
                           true, false );
View Full Code Here

    }

    public void testGetServiceClasses()
        throws Exception
    {
        final ComponentVerifier verifier = new ComponentVerifier();
        MetaClassIntrospector.setAccessor( new BadServiceAccessor() );
        MetaClassIntrospector.clearCompleteCache();
        final List issues = new ArrayList();
        verifier.getServiceClasses( ComponentVerifier.class, issues );
        assertSingleIssue( issues,
                           "Unable to load service interface " +
                           BadServiceAccessor.BAD_SERVICE +
                           " for class. Reason: " +
                           "java.lang.ClassNotFoundException: I-No-Exist!.",
View Full Code Here

            new ClassDescriptor( BasicComponent.class.getName(),
                                 attributes,
                                 attributes,
                                 FieldDescriptor.EMPTY_SET,
                                 MethodDescriptor.EMPTY_SET );
        final ComponentVerifier verifier = new ComponentVerifier();
        final RegistrationMetaClassAccessor accessor = new RegistrationMetaClassAccessor();
        accessor.registerDescriptor( descriptor );
        MetaClassIntrospector.setAccessor( accessor );
        MetaClassIntrospector.clearCompleteCache();
        final VerifyIssue[] issues = verifier.verifyType( BasicComponent.class );
        assertEquals( "issues.length", 0, issues.length );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.dna.tools.verifier.ComponentVerifier

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.