1
2
3
4
5
6
7
8
9
10
11 package org.mule.context;
12
13 import org.mule.api.MuleContext;
14 import org.mule.api.MuleException;
15 import org.mule.tck.AbstractMuleTestCase;
16
17 public class DefaultMuleContextTestCase extends AbstractMuleTestCase
18 {
19
20 public void testDisposal() throws MuleException, InterruptedException
21 {
22 int threadsBeforeStart = Thread.activeCount();
23 MuleContext ctx = new DefaultMuleContextFactory().createMuleContext();
24 ctx.start();
25 assertTrue(Thread.activeCount() > threadsBeforeStart);
26 ctx.stop();
27 ctx.dispose();
28
29 assertTrue(Thread.activeCount() == threadsBeforeStart);
30 assertTrue(ctx.isDisposed());
31 assertFalse(ctx.isInitialised());
32 assertFalse(ctx.isStarted());
33 }
34
35
36 protected MuleContext createMuleContext() throws Exception
37 {
38 return null;
39 }
40
41
42 protected void disposeManager()
43 {
44 }
45
46 }