KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > orb > rmi > RMITestUtil


1 package org.jacorb.test.orb.rmi;
2
3 import org.jacorb.test.orb.rmi.Boo;
4 import org.jacorb.test.orb.rmi.Foo;
5
6 /*
7  * JacORB - a free Java ORB
8  *
9  * Copyright (C) 1997-2003 Gerald Brose.
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */

25
26 public class RMITestUtil
27 {
28     public final static String JavaDoc STRING =
29         "the quick brown fox jumps over the lazy dog";
30
31     public static String JavaDoc primitiveTypesToString(boolean flag, char c, byte b,
32                                                 short s, int i, long l,
33                                                 float f, double d)
34     {
35         String JavaDoc str = "flag:\t" + flag + "\n"
36                     + "c:\t" + c + "\n"
37                     + "b:\t" + b + "\n"
38                     + "s:\t" + s + "\n"
39                     + "i:\t" + i + "\n"
40                     + "l:\t" + l + "\n"
41                     + "f:\t" + f + "\n"
42                     + "d:\t" + d + "\n";
43         return str;
44     }
45
46     public static String JavaDoc echo(String JavaDoc s)
47     {
48         return s + " (echoed back)";
49     }
50
51     public static Foo echoFoo(Foo f)
52     {
53         Foo newFoo = new Foo(f.i, f.s);
54         newFoo.i++;
55         newFoo.s += " <";
56         return newFoo;
57     }
58
59     public static Boo echoBoo(Boo f)
60     {
61         Boo newBoo = new Boo(f.id, f.name);
62         newBoo.id += "+";
63         newBoo.name += " <";
64         return newBoo;
65     }
66
67 }
68
Popular Tags