Search in sources :

Example 1 with AbstractProcessor

use of org.mule.runtime.core.internal.processor.AbstractProcessor in project mule by mulesoft.

the class ObjectTypeVisitorTestCase method typeIsInstanceOfClassInheritedFromCheckedClassFromAttribute.

@Test
public void typeIsInstanceOfClassInheritedFromCheckedClassFromAttribute() throws ClassNotFoundException {
    ComponentModel componentModel = new SpringComponentModel();
    componentModel.setParameter("type", "org.mule.runtime.core.internal.processor.ReferenceProcessor");
    ObjectTypeVisitor visitor = new ObjectTypeVisitor(componentModel);
    // Check that ReferenceProcessor inherits from AbstractProcessor
    TypeDefinition typeDefinition = fromConfigurationAttribute("type").checkingThatIsClassOrInheritsFrom(AbstractProcessor.class);
    typeDefinition.visit(visitor);
    assertTrue(AbstractProcessor.class.isAssignableFrom(visitor.getType()));
}
Also used : SpringComponentModel(org.mule.runtime.config.internal.dsl.model.SpringComponentModel) ComponentModel(org.mule.runtime.config.internal.model.ComponentModel) SpringComponentModel(org.mule.runtime.config.internal.dsl.model.SpringComponentModel) AbstractProcessor(org.mule.runtime.core.internal.processor.AbstractProcessor) ObjectTypeVisitor(org.mule.runtime.config.internal.dsl.processor.ObjectTypeVisitor) TypeDefinition(org.mule.runtime.dsl.api.component.TypeDefinition) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 SpringComponentModel (org.mule.runtime.config.internal.dsl.model.SpringComponentModel)1 ObjectTypeVisitor (org.mule.runtime.config.internal.dsl.processor.ObjectTypeVisitor)1 ComponentModel (org.mule.runtime.config.internal.model.ComponentModel)1 AbstractProcessor (org.mule.runtime.core.internal.processor.AbstractProcessor)1 TypeDefinition (org.mule.runtime.dsl.api.component.TypeDefinition)1