01: /*
02: * MessageQueueClient: The message queue client library
03: * Copyright (C) 2007 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * RPCMessageImplTest.java
20: */
21:
22: package com.rift.coad.daemon.messageservice.message;
23:
24: import junit.framework.*;
25: import java.util.Date;
26: import java.util.List;
27: import com.rift.coad.lib.common.ObjectSerializer;
28: import com.rift.coad.daemon.messageservice.MessageServiceException;
29: import com.rift.coad.daemon.messageservice.RPCMessage;
30: import com.rift.coad.daemon.messageservice.message.rpc.RPCXMLParser;
31:
32: /**
33: *
34: * @author mincemeat
35: */
36: public class RPCMessageImplTest extends TestCase {
37:
38: public RPCMessageImplTest(String testName) {
39: super (testName);
40: }
41:
42: protected void setUp() throws Exception {
43: }
44:
45: protected void tearDown() throws Exception {
46: }
47:
48: /**
49: * Test of class com.rift.coad.daemon.messageservice.message.RPCMessageImpl.
50: */
51: public void testRPCMessageImpl() throws Exception {
52: System.out.println("testClearBody");
53:
54: RPCMessageImpl message = new RPCMessageImpl("test", "test",
55: "test", null, 1);
56: message.defineMethod(java.lang.Long.class, "test", new Class[] {
57: java.lang.String.class, java.lang.Integer.class });
58:
59: System.out.println(message.getMethodBodyXML());
60:
61: assertEquals(java.lang.Long.class, message.getReturnType());
62: assertEquals("test", message.getMethodName());
63:
64: Object[] arguments = message.getArgumentTypes();
65: assertEquals(2, arguments.length);
66: assertEquals(java.lang.String.class, arguments[0]);
67: assertEquals(java.lang.Integer.class, arguments[1]);
68:
69: message.clearBody();
70:
71: System.out.println(message.getMethodBodyXML());
72: }
73:
74: }
|