1
2
3
4
5
6
7
8
9
10
11 package org.mule.context.notification;
12
13 import org.mule.module.client.MuleClient;
14
15
16
17
18
19 public class ComponentMessageNotificationTestCase extends AbstractNotificationTestCase
20 {
21
22 protected String getConfigResources()
23 {
24 return "org/mule/test/integration/notifications/component-message-notification-test.xml";
25 }
26
27 public void doTest() throws Exception
28 {
29 MuleClient client = new MuleClient();
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 public RestrictedNode getSpecification()
36 {
37 return new Node().parallel(
38 new Node(ComponentMessageNotification.class, ComponentMessageNotification.COMPONENT_PRE_INVOKE))
39 .parallel(
40 new Node(ComponentMessageNotification.class,
41 ComponentMessageNotification.COMPONENT_POST_INVOKE))
42 .parallel(
43 new Node(ComponentMessageNotification.class,
44 ComponentMessageNotification.COMPONENT_PRE_INVOKE))
45 .parallel(
46 new Node(ComponentMessageNotification.class,
47 ComponentMessageNotification.COMPONENT_POST_INVOKE));
48 }
49
50 public void validateSpecification(RestrictedNode spec) throws Exception
51 {
52 verifyAllNotifications(spec, ComponentMessageNotification.class,
53 ComponentMessageNotification.COMPONENT_PRE_INVOKE,
54 ComponentMessageNotification.COMPONENT_POST_INVOKE);
55 }
56 }