KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > orb > RecursiveParam


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

22
23 import junit.framework.*;
24 import junit.extensions.*;
25 import java.io.*;
26 import org.omg.CORBA.*;
27 import org.jacorb.test.common.*;
28 import org.jacorb.util.*;
29 import org.jacorb.test.*;
30 import org.jacorb.test.RecursiveParamServerPackage.*;
31 import org.jacorb.test.RecursiveParamServerPackage.ParmPackage.*;
32
33 public class RecursiveParam extends ClientServerTestCase
34 {
35     private RecursiveParamServer server;
36
37     public RecursiveParam(String JavaDoc name, ClientServerSetup setup)
38     {
39         super(name, setup);
40     }
41
42     public void setUp() throws Exception JavaDoc
43     {
44         server = RecursiveParamServerHelper.narrow( setup.getServerObject() );
45     }
46
47     public static Test suite()
48     {
49         TestSuite suite = new TestSuite
50             ( "Client/server recursiveparam tests" );
51         ClientServerSetup setup = new ClientServerSetup
52             ( suite, "org.jacorb.test.orb.RecursiveParamServerImpl" );
53
54         suite.addTest( new RecursiveParam( "test_param1", setup ) );
55
56         return setup;
57     }
58
59     public void test_param1()
60     {
61         ParmValue pv = new ParmValue();
62         pv.string_value("inner");
63         Parm p = new Parm("v", pv );
64
65         ParmValue pvi = new ParmValue();
66         Parm[][] pp = new Parm[1][1];
67         pp[0] = new Parm[]{p};
68         pvi.nested_value( pp );
69
70         Parm outerParm = new Parm("outer", pvi );
71         server.passParm( outerParm );
72
73         org.omg.CORBA.Any JavaDoc any = setup.getClientOrb().create_any();
74
75         blubT union = new blubT();
76         blubT[] blubs = new blubT[0];
77
78         union.b( blubs );
79         blubTHelper.insert( any, union );
80
81         server.passAny( any );
82     }
83 }
84
Popular Tags