1
2
3
4
5
6
7 package org.mule.context.notification;
8
9 import org.mule.module.client.MuleClient;
10
11 import static org.junit.Assert.assertNotNull;
12
13
14
15
16
17 public class ComponentMessageNotificationTestCase extends AbstractNotificationTestCase
18 {
19
20 @Override
21 protected String getConfigResources()
22 {
23 return "org/mule/test/integration/notifications/component-message-notification-test.xml";
24 }
25
26 @Override
27 public void doTest() throws Exception
28 {
29 MuleClient client = new MuleClient(muleContext);
30 assertNotNull(client.send("vm://in-1?connector=direct", "hello sweet world", null));
31 client.dispatch("vm://in-2?connector=direct", "goodbye cruel world", null);
32 assertNotNull(client.request("vm://out-2?connector=queue", 5000));
33 }
34
35 @Override
36 public RestrictedNode getSpecification()
37 {
38 return new Node().parallel(
39 new Node(ComponentMessageNotification.class, ComponentMessageNotification.COMPONENT_PRE_INVOKE))
40 .parallel(
41 new Node(ComponentMessageNotification.class,
42 ComponentMessageNotification.COMPONENT_POST_INVOKE))
43 .parallel(
44 new Node(ComponentMessageNotification.class,
45 ComponentMessageNotification.COMPONENT_PRE_INVOKE))
46 .parallel(
47 new Node(ComponentMessageNotification.class,
48 ComponentMessageNotification.COMPONENT_POST_INVOKE));
49 }
50
51 @Override
52 public void validateSpecification(RestrictedNode spec) throws Exception
53 {
54 verifyAllNotifications(spec, ComponentMessageNotification.class,
55 ComponentMessageNotification.COMPONENT_PRE_INVOKE,
56 ComponentMessageNotification.COMPONENT_POST_INVOKE);
57 }
58 }