Package org.mule.api.config

Examples of org.mule.api.config.ConfigurationBuilder


    public void testSpringConfigurationBuilderPrecedence() throws Exception
    {
        context = new DefaultMuleContextFactory().createMuleContext();

        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        appContext = new ClassPathXmlApplicationContext("application-context-2.xml");
        builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();

        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here


    public void testSpringConfigurationBuilderBackwardsPrecedence() throws Exception
    {
        context = new DefaultMuleContextFactory().createMuleContext();

        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context-2.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        appContext = new ClassPathXmlApplicationContext("application-context.xml");
        builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();

        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here

        context = new DefaultMuleContextFactory().createMuleContext();

        context.getRegistry().registerObject("orange", new Orange(12, 5.5, "Tutti Frutti"));

        ApplicationContext appContext = new ClassPathXmlApplicationContext("application-context.xml");
        ConfigurationBuilder builder = new SpringConfigurationBuilder(appContext);
        builder.configure(context);

        context.start();

        Object orange = context.getRegistry().lookupObject("orange");
        assertNotNull(orange);
View Full Code Here

{

    @Test(expected = ConfigurationException.class)
    public void expectFailure() throws Exception
    {
        ConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder("integration/config/bean-datasource-with-connection-properties-config.xml");
        configBuilder.configure(muleContext);
    }
View Full Code Here

    @Test
    public void notifiesMuleContextEvents() throws InitialisationException, ConfigurationException
    {
        MuleContextListener listener = mock(MuleContextListener.class);
        ConfigurationBuilder configurationBuilder = mock(ConfigurationBuilder.class);
        context = mock(MuleContext.class);
        MuleContextBuilder contextBuilder = mock(MuleContextBuilder.class);
        when(contextBuilder.buildMuleContext()).thenReturn(context);

        muleContextFactory.addListener(listener);
View Full Code Here

                        CoreMessages.configurationBuilderNoMatching(createConfigResourcesString()));
                }

                ConfigResource[] constructorArg = new ConfigResource[configs.size()];
                System.arraycopy(configs.toArray(), 0, constructorArg, 0, configs.size());
                ConfigurationBuilder cb = (ConfigurationBuilder) ClassUtils.instanciateClass(className, new Object[] {constructorArg});
                if (domainContext != null && cb instanceof DomainMuleContextAwareConfigurationBuilder)
                {
                    ((DomainMuleContextAwareConfigurationBuilder) cb).setDomainContext(domainContext);
                }
                else if (domainContext != null)
                {
                    throw new MuleRuntimeException(CoreMessages.createStaticMessage(String.format("ConfigurationBuilder %s does not support domain context", cb.getClass().getCanonicalName())));
                }
                cb.configure(muleContext);
            }
        }
        catch (ConfigurationException e)
        {
            throw e;
View Full Code Here

    private MuleContext muleContext;

    @Test
    public void testDefaultJavaComponentShortcut() throws Exception
    {
        ConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(
            "org/mule/config/spring/parsers/specific/component-ok-test-flow.xml");
        muleContext = muleContextFactory.createMuleContext(configBuilder);
        Flow service = muleContext.getRegistry().lookupObject("service1");
        validateCorrectServiceCreation(service);
        assertEquals(DefaultJavaComponent.class, service.getMessageProcessors().get(0).getClass());
View Full Code Here

    }

    @Test
    public void testDefaultJavaComponentPrototype() throws Exception
    {
        ConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(
            "org/mule/config/spring/parsers/specific/component-ok-test-flow.xml");
        muleContext = muleContextFactory.createMuleContext(configBuilder);
        Flow service = muleContext.getRegistry().lookupObject("service2");
        validateCorrectServiceCreation(service);
        assertEquals(DefaultJavaComponent.class, service.getMessageProcessors().get(0).getClass());
View Full Code Here

    }

    @Test
    public void testDefaultJavaComponentSingleton() throws Exception
    {
        ConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(
            "org/mule/config/spring/parsers/specific/component-ok-test-flow.xml");
        muleContext = muleContextFactory.createMuleContext(configBuilder);
        Flow service = muleContext.getRegistry().lookupObject("service3");
        validateCorrectServiceCreation(service);
        assertEquals(DefaultJavaComponent.class, service.getMessageProcessors().get(0).getClass());
View Full Code Here

    }

    @Test
    public void testDefaultJavaComponentSpringBean() throws Exception
    {
        ConfigurationBuilder configBuilder = new SpringXmlConfigurationBuilder(
            "org/mule/config/spring/parsers/specific/component-ok-test-flow.xml");
        muleContext = muleContextFactory.createMuleContext(configBuilder);
        Flow service = muleContext.getRegistry().lookupObject("service4");
        validateCorrectServiceCreation(service);
        assertEquals(DefaultJavaComponent.class, service.getMessageProcessors().get(0).getClass());
View Full Code Here

TOP

Related Classes of org.mule.api.config.ConfigurationBuilder

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.