1
2
3
4
5
6
7
8
9
10
11 package org.mule.config.spring;
12
13 import org.mule.api.MuleRuntimeException;
14 import org.mule.tck.FunctionalTestCase;
15
16 import org.springframework.beans.FatalBeanException;
17
18 public class BeanCreationExceptionPropagationTestCase extends FunctionalTestCase
19 {
20 protected String getConfigResources()
21 {
22 return "org/mule/config/spring/bean-creation-exception-propagation-config.xml";
23 }
24
25 @Override
26 protected boolean isStartContext()
27 {
28
29 return false;
30 }
31
32 public void testBeanCreationExceptionPropagation()
33 {
34
35 try
36 {
37 muleContext.getRegistry().lookupObjects(Object.class);
38 fail("Should've failed with an exception");
39 }
40 catch (MuleRuntimeException e)
41 {
42 Throwable t = e.getCause();
43 assertNotNull(t);
44 assertTrue(t instanceof FatalBeanException);
45 }
46 }
47 }