KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > messageservice > message > RPCMessageImplTest


1 /*
2  * MessageQueueClient: The message queue client library
3  * Copyright (C) 2007 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
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 JavaDoc;
26 import java.util.List JavaDoc;
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 JavaDoc testName) {
39         super(testName);
40     }
41
42     protected void setUp() throws Exception JavaDoc {
43     }
44
45     protected void tearDown() throws Exception JavaDoc {
46     }
47
48     /**
49      * Test of class com.rift.coad.daemon.messageservice.message.RPCMessageImpl.
50      */

51     public void testRPCMessageImpl() throws Exception JavaDoc {
52         System.out.println("testClearBody");
53         
54         RPCMessageImpl message = new RPCMessageImpl("test", "test", "test",
55             null, 1);
56         message.defineMethod(java.lang.Long JavaDoc.class,"test",new Class JavaDoc[] {
57             java.lang.String JavaDoc.class,java.lang.Integer JavaDoc.class});
58         
59         System.out.println(message.getMethodBodyXML());
60         
61         assertEquals(java.lang.Long JavaDoc.class, message.getReturnType());
62         assertEquals("test", message.getMethodName());
63         
64         Object JavaDoc[] arguments = message.getArgumentTypes();
65         assertEquals(2, arguments.length);
66         assertEquals(java.lang.String JavaDoc.class, arguments[0]);
67         assertEquals(java.lang.Integer JavaDoc.class, arguments[1]);
68         
69         message.clearBody();
70         
71         System.out.println(message.getMethodBodyXML());
72     }
73
74     
75 }
76
Popular Tags