1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.ksb.messaging;
17
18 import javax.xml.namespace.QName;
19
20 import org.junit.Test;
21 import org.kuali.rice.core.config.ConfigContext;
22 import org.kuali.rice.ksb.messaging.PersistedMessage;
23 import org.kuali.rice.ksb.messaging.service.KSBJavaService;
24 import org.kuali.rice.ksb.service.KSBServiceLocator;
25 import org.kuali.rice.ksb.test.KSBTestCase;
26 import org.kuali.rice.ksb.util.KSBConstants;
27
28
29
30
31
32
33
34 public class Value1AndValue2PersistedOnMessageCall extends KSBTestCase {
35
36 @Test public void testCallingQueueAsnyc() throws Exception {
37 KSBTestUtils.setMessagingToAsync();
38 ConfigContext.getCurrentContextConfig().putProperty(KSBConstants.MESSAGING_OFF, "true");
39
40 QName serviceName = QName.valueOf("{testAppsSharedTopic}sharedTopic");
41 String value1 = "value1";
42 String value2 = "value2";
43 KSBJavaService testJavaAsyncService = (KSBJavaService) KSBServiceLocator.getMessageHelper().getServiceAsynchronously(serviceName, null, null, value1, value2);
44 testJavaAsyncService.invoke(new ClientAppServiceSharedPayloadObj("message content", false));
45
46 PersistedMessage message = KSBServiceLocator.getRouteQueueService().getNextDocuments(null).get(0);
47 assertEquals("value1 incorrectly saved", value1, message.getValue1());
48 assertEquals("value2 incorrectly saved", value2, message.getValue2());
49
50 }
51
52 }