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 static org.junit.Assert.assertEquals;
19
20 import javax.xml.namespace.QName;
21
22 import org.junit.Test;
23 import org.kuali.rice.core.api.config.property.ConfigContext;
24 import org.kuali.rice.ksb.api.KsbApiServiceLocator;
25 import org.kuali.rice.ksb.messaging.service.KSBJavaService;
26 import org.kuali.rice.ksb.service.KSBServiceLocator;
27 import org.kuali.rice.ksb.test.KSBTestCase;
28 import org.kuali.rice.ksb.util.KSBConstants;
29
30
31
32
33
34
35
36 public class Value1AndValue2PersistedOnMessageCall extends KSBTestCase {
37
38 @Test public void testCallingQueueAsnyc() throws Exception {
39 KSBTestUtils.setMessagingToAsync();
40 ConfigContext.getCurrentContextConfig().putProperty(KSBConstants.Config.MESSAGING_OFF, "true");
41
42 QName serviceName = QName.valueOf("{testAppsSharedTopic}sharedTopic");
43 String value1 = "value1";
44 String value2 = "value2";
45 KSBJavaService testJavaAsyncService = (KSBJavaService) KsbApiServiceLocator.getMessageHelper().getServiceAsynchronously(serviceName, null, null, value1, value2);
46 testJavaAsyncService.invoke(new ClientAppServiceSharedPayloadObj("message content", false));
47
48 PersistedMessageBO message = KSBServiceLocator.getMessageQueueService().getNextDocuments(null).get(0);
49 assertEquals("value1 incorrectly saved", value1, message.getValue1());
50 assertEquals("value2 incorrectly saved", value2, message.getValue2());
51
52 }
53
54 }