Package org.mule.api

Examples of org.mule.api.MuleContext


    }

    @Test(expected=IllegalStateException.class)
    public void initialiseOnInitialised() throws MuleException
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();

        // Can't call twice
        ctx.initialise();
    }
View Full Code Here


    }
   
    @Test(expected=IllegalStateException.class)
    public void initialiseOnStarted() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
        new DefaultsConfigurationBuilder().configure(ctx);
        ctx.start();

        // Attempt to initialise once started should fail!
        ctx.initialise();
    }
View Full Code Here

    }

    @Test(expected=IllegalStateException.class)
    public void initialiseOnStopped() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
        new DefaultsConfigurationBuilder().configure(ctx);
        ctx.start();
        ctx.stop();
       
        // Attempt to initialise once stopped should fail!
        ctx.initialise();
    }
View Full Code Here

    }

    @Test(expected=IllegalStateException.class)
    public void initialiseOnDisposed() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
        new DefaultsConfigurationBuilder().configure(ctx);
        ctx.start();
        ctx.stop();
        ctx.dispose();

        // Attempt to initialise once disposed should fail!
        ctx.initialise();
    }
View Full Code Here

    // Start
    //   
    @Test(expected=IllegalStateException.class)
    public void startBeforeInitialise() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.start();
    }
View Full Code Here

    }
   
    @Test
    public void startOnInitialised() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
       
        new DefaultsConfigurationBuilder().configure(ctx);
        NotificationListener listener = new NotificationListener();
        ctx.registerListener(listener);
        ctx.start();
       
        assertTrue(ctx.isInitialised());
        assertFalse(ctx.isInitialising());
        assertTrue(ctx.isStarted());
        assertFalse(ctx.isDisposed());
        assertFalse(ctx.isDisposing());

        assertTrue("CONTEXT_STARTING notification never fired", listener.startingNotificationFired);
        assertTrue("CONTEXT_STARTED notification never fired", listener.startedNotificationFired);
    }
View Full Code Here

    }

    @Test(expected=IllegalStateException.class)
    public void startOnStarted() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
       
        new DefaultsConfigurationBuilder().configure(ctx);
        NotificationListener listener = new NotificationListener();
        ctx.registerListener(listener);
        ctx.start();

        assertTrue("CONTEXT_STARTING notification never fired", listener.startingNotificationFired);
        assertTrue("CONTEXT_STARTED notification never fired", listener.startedNotificationFired);
       
        // Can't call twice
        ctx.start();
    }
View Full Code Here

    }

    @Test
    public void startOnStopped() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
        new DefaultsConfigurationBuilder().configure(ctx);
        ctx.start();

        ctx.stop();
        ctx.start();
        assertTrue(ctx.isInitialised());
        assertFalse(ctx.isInitialising());
        assertTrue(ctx.isStarted());
        assertFalse(ctx.isDisposed());
        assertFalse(ctx.isDisposing());
    }
View Full Code Here

    }

    @Test(expected=IllegalStateException.class)
    public void startOnDisposed() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();
        ctx.initialise();
        ctx.dispose();
       
        // Attempt to start once disposed should fail!
        ctx.start();
    }
View Full Code Here

    // Stop
    //
    @Test(expected=IllegalStateException.class)
    public void stopBeforeInitialise() throws Exception
    {
        MuleContext ctx = ctxBuilder.buildMuleContext();

        // Attempt to stop before initialise should fail!
        ctx.stop();
    }
View Full Code Here

TOP

Related Classes of org.mule.api.MuleContext

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.