1
2
3
4
5
6
7
8
9
10
11 package org.mule.extras.spring.config;
12
13 import org.mule.MuleManager;
14 import org.mule.tck.FunctionalTestCase;
15 import org.mule.umo.manager.ObjectNotFoundException;
16 import org.mule.umo.manager.UMOContainerContext;
17
18
19
20
21 public class EmbeddedBeansXmlTestCase extends FunctionalTestCase
22 {
23
24 protected String getConfigResources()
25 {
26 return "test-embedded-spring-config.xml";
27 }
28
29 protected void doFunctionalSetUp() throws Exception
30 {
31 System.setProperty("org.mule.xml.validate", "false");
32 }
33
34 protected void doFunctionalTearDown() throws Exception
35 {
36 System.setProperty("org.mule.xml.validate", "true");
37 }
38
39 public void testContainer() throws Exception
40 {
41 UMOContainerContext context = MuleManager.getInstance().getContainerContext();
42 assertNotNull(context);
43 assertNotNull(context.getComponent("Apple"));
44 assertNotNull(context.getComponent("Banana"));
45
46 try
47 {
48 context.getComponent("Orange");
49 fail("Object should not found");
50 }
51 catch (ObjectNotFoundException e)
52 {
53
54 }
55 }
56 }