Package org.mule.common.config

Examples of org.mule.common.config.XmlConfigurationMuleArtifactFactory


public abstract class XmlConfigurationMuleArtifactFactoryTestCase extends AbstractMuleTestCase
{

    protected void doTestMessageProcessorArtifactRetrieval(Document document, XmlConfigurationCallback callback) throws MuleArtifactFactoryException
    {
        XmlConfigurationMuleArtifactFactory factory = lookupArtifact();
        MuleArtifact artifact = null;

        try
        {
            artifact = factory.getArtifactForMessageProcessor(document.getDocumentElement(), callback);

            assertNotNull(artifact);
        }
        finally
        {
            if (artifact != null)
            {
                factory.returnArtifact(artifact);
            }
        }
    }
View Full Code Here


    }

    private void doTestMessageProcessor(Document document, XmlConfigurationCallback callback, TestResult.Status expectedResult)
            throws MuleArtifactFactoryException
    {
        XmlConfigurationMuleArtifactFactory factory = lookupArtifact();
        MuleArtifact artifact = null;

        try
        {
            artifact = factory.getArtifactForMessageProcessor(document.getDocumentElement(), callback);

            assertNotNull(artifact);
            assertTrue(artifact.hasCapability(OperationMetaDataEnabled.class));
            assertTrue(artifact.getCapability(OperationMetaDataEnabled.class) instanceof OperationMetaDataEnabled);
            if (expectedResult != null)
            {
                OperationMetaDataEnabled artifactCapability = artifact.getCapability(OperationMetaDataEnabled.class);
                assertNull(artifactCapability.getInputMetaData());
                assertEquals(expectedResult, artifactCapability.getOutputMetaData(null).getStatus());
            }
        }
        finally
        {
            if (artifact != null)
            {
                factory.returnArtifact(artifact);
            }
        }

    }
View Full Code Here

    }

    private void doTest(Document document, XmlConfigurationCallback callback, TestResult.Status expectedResult)
            throws MuleArtifactFactoryException
    {
        XmlConfigurationMuleArtifactFactory factory = lookupArtifact();
        MuleArtifact artifact = null;

        try
        {
            artifact = factory.getArtifact(document.getDocumentElement(), callback);
            assertNotNull(artifact);
            assertTrue(artifact.hasCapability(Testable.class));
            assertTrue(artifact.getCapability(Testable.class) instanceof Testable);
            if (expectedResult != null)
            {
                Testable artifactCapability = artifact.getCapability(Testable.class);
                assertEquals(expectedResult, artifactCapability.test().getStatus());
            }
        }
        finally
        {
            if (artifact != null)
            {
                factory.returnArtifact(artifact);
            }
        }

    }
View Full Code Here

TOP

Related Classes of org.mule.common.config.XmlConfigurationMuleArtifactFactory

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.