/[classpath]/classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java
ViewVC logotype

Diff of /classpath/examples/gnu/classpath/examples/CORBA/SimpleCommunication/communication/DirectTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.2 by gnu_andrew, Tue Aug 2 20:12:07 2005 UTC revision 1.1.2.3 by gnu_andrew, Wed Nov 2 00:43:21 2005 UTC
# Line 57  import java.io.IOException; Line 57  import java.io.IOException;
57   * where the program has been started.   * where the program has been started.
58   *   *
59   * The IOR.txt file is written by the server   * The IOR.txt file is written by the server
60   * {@link gnu.classpath.examples.CORBA.SimpleCommunication.comServer}.   * {@link gnu.classpath.examples.CORBA.SimpleCommunication.DemoServer}.
61   * The server should be reachable over Internet, unless blocked by   * The server should be reachable over Internet, unless blocked by
62   * security tools.   * security tools.
63   *   *
# Line 83  public class DirectTest Line 83  public class DirectTest
83    /**    /**
84     * The invocation target.     * The invocation target.
85     */     */
86    comTester object;    DemoTester object;
87    
88    /**    /**
89     * Get the object reference.     * Get the object reference.
# Line 102  public class DirectTest Line 102  public class DirectTest
102    
103          String ior = new String(c);          String ior = new String(c);
104          DirectTest we = new DirectTest();          DirectTest we = new DirectTest();
105          we.object = (comTester) orb.string_to_object(ior);          we.object = (DemoTester) orb.string_to_object(ior);
106          we.Demo();          we.Demo();
107          orb.shutdown(false);          orb.shutdown(false);
108        }        }
# Line 199  public class DirectTest Line 199  public class DirectTest
199    {    {
200      System.out.println("***** Pass structure");      System.out.println("***** Pass structure");
201    
202      passThis arg = new passThis();      StructureToPass arg = new StructureToPass();
203      arg.a = "A";      arg.a = "A";
204      arg.b = "B";      arg.b = "B";
205    
206      returnThis r = object.passStructure(arg);      StructureToReturn r = object.passStructure(arg);
207    
208      System.out.println("  Fields of the returned structure:");      System.out.println("  Fields of the returned structure:");
209    
# Line 257  public class DirectTest Line 257  public class DirectTest
257      //      +-- bb      //      +-- bb
258      System.out.println("***** Pass and return the tree.");      System.out.println("***** Pass and return the tree.");
259    
260      node n = nod("Root");      TreeNode n = nod("Root");
261    
262      n.children = new node[] { nod("a"), nod("b") };      n.children = new TreeNode[] { nod("a"), nod("b") };
263      n.children [ 1 ].children = new node[] { nod("ba"), nod("bb") };      n.children [ 1 ].children = new TreeNode[] { nod("ba"), nod("bb") };
264      n.children [ 1 ].children [ 0 ].children = new node[] { nod("bac") };      n.children [ 1 ].children [ 0 ].children = new TreeNode[] { nod("bac") };
265    
266      nodeHolder nh = new nodeHolder(n);      TreeNodeHolder nh = new TreeNodeHolder(n);
267    
268      // The server should add '++' to each node name.      // The server should add '++' to each TreeNode name.
269      object.passTree(nh);      object.passTree(nh);
270    
271      // Convert the returned tree to some strig representation.      // Convert the returned tree to some strig representation.
# Line 288  public class DirectTest Line 288  public class DirectTest
288          object.throwException(123);          object.throwException(123);
289          throw new InternalError();          throw new InternalError();
290        }        }
291      catch (ourUserException uex)      catch (WeThrowThisException uex)
292        {        {
293          System.out.println("  The user exception with field " + uex.ourField +          System.out.println("  The user exception with field " + uex.ourField +
294                             ", has been thrown on remote side."                             ", has been thrown on remote side."
# Line 312  public class DirectTest Line 312  public class DirectTest
312    /**    /**
313     * Get the string representation of the passed tree.     * Get the string representation of the passed tree.
314     * @param b the string buffer to accumulate the representation.     * @param b the string buffer to accumulate the representation.
315     * @param n the tree (root node).     * @param n the tree (root TreeNode).
316     */     */
317    private void getImage(StringBuffer b, node n)    private void getImage(StringBuffer b, TreeNode n)
318    {    {
319      b.append(n.name);      b.append(n.name);
320      b.append(": (");      b.append(": (");
# Line 328  public class DirectTest Line 328  public class DirectTest
328    }    }
329    
330    /**    /**
331     * Create a node with the given header.     * Create a TreeNode with the given header.
332     *     *
333     * @param hdr the node header.     * @param hdr the TreeNode header.
334     * @return the created node.     * @return the created TreeNode.
335     */     */
336    private node nod(String hdr)    private TreeNode nod(String hdr)
337    {    {
338      node n = new node();      TreeNode n = new TreeNode();
339      n.children = new node[ 0 ];      n.children = new TreeNode[ 0 ];
340      n.name = hdr;      n.name = hdr;
341    
342      return n;      return n;

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.1.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26