package test;

import java.util.Properties;
import org.omg.CORBA.*;
import org.omg.PortableServer.*;
import org.omg.IOP.IOR;

class Test {
    public static ORB orb;
    public static test.i object;
    public static boolean ready = false;

    public static void main(String args[]) {
	Properties props = new Properties();
	props.put("org.omg.PortableInterceptor.ORBInitializerClass."
		+ "test.ORBInitializer", "");
	props.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
	props.put("org.omg.CORBA.ORBSingletonClass",
		"org.jacorb.orb.ORBSingleton");
		
	try {
	    orb = ORB.init((String[]) null, props);
	    final POA poa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
	    poa.the_POAManager().activate();
	
	    final String ref1 = "IOR:000000000000000f49444c3a746573742f693a312e300000000000010000000000000082000102000000000a3132372e302e312e3100c55d00000031afabcb000000002038168fa300000001000000000000000100000008526f6f74504f410000000008000000010000000014000000000000020000000100000020000000000001000100000002050100010001002000010109000000010001010000000026000000020002";
	    final String ref2 = "IOR:000000000000000f49444c3a746573742f693a312e300000000000010000000000000082000102000000000a3132372e302e312e3100882300000031afabcb0000000020381e7d5d00000001000000000000000100000008526f6f74504f410000000008000000010000000014000000000000020000000100000020000000000001000100000002050100010001002000010109000000010001010000000026000000020002";
	
	    test.i t1 = test.iHelper.narrow(orb.string_to_object(ref1));
	    test.i t2 = test.iHelper.narrow(orb.string_to_object(ref2));
	    
	    object = t2;
	    
	    ready = true;
	    
	    System.out.println("Invoking test.i.f function ");
	    t1.f();
	}
	catch (Exception e) {
	    System.out.println("Got Exception: " + e);
	}
    }
}
