1
2
3
4
5
6
7
8
9
10
11 package org.mule.config.spring;
12
13 import org.mule.api.MuleMessage;
14 import org.mule.module.client.MuleClient;
15 import org.mule.tck.FunctionalTestCase;
16
17 public class InterceptorAdapterTestCase extends FunctionalTestCase
18 {
19
20 public static final String MESSAGE = "squeak";
21
22 protected String getConfigResources()
23 {
24 return "org/mule/config/spring/interceptor-adapter-test.xml";
25 }
26
27 public void testInterceptor() throws Exception
28 {
29 MuleClient client = new MuleClient();
30 MuleMessage response = client.send("vm://in", MESSAGE, null);
31 assertEquals(MESSAGE, response.getPayloadAsString());
32 TimingInterceptor timer = (TimingInterceptor) muleContext.getRegistry().lookupObject("timer");
33 assertNotNull(timer);
34 long ms = timer.getInterval();
35 assertTrue(TimingInterceptor.UNCALLED != ms);
36 }
37
38 }