1   /*
2    * $Id: EmbeddedMuleTestCase.java 10787 2008-02-12 18:51:50Z dfeist $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule;
12  
13  import org.mule.api.MuleContext;
14  import org.mule.api.context.MuleContextFactory;
15  import org.mule.config.spring.SpringXmlConfigurationBuilder;
16  import org.mule.context.DefaultMuleContextFactory;
17  
18  import junit.framework.TestCase;
19  
20  public class EmbeddedMuleTestCase extends TestCase
21  {
22      public void testStartup() throws Exception
23      {
24          SpringXmlConfigurationBuilder builder = new SpringXmlConfigurationBuilder(
25              "org/mule/test/spring/mule-root-test.xml");
26          MuleContextFactory muleContextFactory = new DefaultMuleContextFactory();
27          MuleContext context = muleContextFactory.createMuleContext(builder);
28          // MuleContext must be started explicitly after MULE-1988
29          assertFalse(context.isStarted());
30          context.start();
31          assertTrue(context.isStarted());
32      }
33  }