01: /*
02: * Copyright 2007 The Kuali Foundation
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package edu.iu.uis.eden.messaging;
17:
18: import javax.xml.namespace.QName;
19:
20: import org.junit.Test;
21: import org.kuali.bus.services.KSBServiceLocator;
22: import org.kuali.bus.test.KSBTestCase;
23: import org.kuali.rice.RiceConstants;
24: import org.kuali.rice.core.Core;
25:
26: import edu.iu.uis.eden.messaging.callbacks.SimpleCallback;
27:
28: /**
29: * verify that value1 and value2 are preserved when passed into message helper and making an async call.
30: *
31: * @author Kuali Rice Team (kuali-rice@googlegroups.com)
32: *
33: */
34: public class Value1AndValue2PersistedOnMessageCall extends KSBTestCase {
35:
36: @Test
37: public void testCallingQueueAsnyc() throws Exception {
38: KSBTestUtils.setMessagingToAsync();
39: Core.getCurrentContextConfig().overrideProperty(
40: RiceConstants.MESSAGING_OFF, "true");
41:
42: QName serviceName = QName
43: .valueOf("{testAppsSharedTopic}sharedTopic");
44: SimpleCallback callback = new SimpleCallback();
45: String value1 = "value1";
46: String value2 = "value2";
47: KEWJavaService testJavaAsyncService = (KEWJavaService) KSBServiceLocator
48: .getMessageHelper().getServiceAsynchronously(
49: serviceName, callback, null, value1, value2);
50: testJavaAsyncService
51: .invoke(new ClientAppServiceSharedPayloadObj(
52: "message content", false));
53:
54: PersistedMessage message = KSBServiceLocator
55: .getRouteQueueService().getNextDocuments(null).get(0);
56: assertEquals("value1 incorrectly saved", value1, message
57: .getValue1());
58: assertEquals("value2 incorrectly saved", value2, message
59: .getValue2());
60:
61: }
62:
63: }
|