use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class NestedOnePhaseServer method run.
/**
* The main test method which must assert either a pass or a fail.
*/
public void run(String[] args) {
try {
String serviceName = args[args.length - 2];
String serviceName2 = args[args.length - 1];
/**
* Retrieve ORB and OA references, intialise them
* and then set the OTSManager ORB and OA properties
*/
ORB orb = ORB.getInstance(PerformanceFramework.ORB_INSTANCE_NAME);
OA oa = OA.getRootOA(orb);
orb.initORB(args, null);
oa.initOA(args);
OTSManager.setORB(orb);
OTSManager.setPOA(oa);
SingleResourceRegistration obj1 = new SingleResourceRegistration();
oa.objectIsReady(obj1);
PerfTestInterface objRef1 = PerfTestInterfaceHelper.narrow(oa.corbaReference(obj1));
ServerIORStore.storeIOR(serviceName, orb.orb().object_to_string(objRef1));
DummyPerfTestImplementation obj2 = new DummyPerfTestImplementation();
oa.objectIsReady(obj2);
PerfTestInterface objRef2 = PerfTestInterfaceHelper.narrow(oa.corbaReference(obj2));
ServerIORStore.storeIOR(serviceName2, orb.orb().object_to_string(objRef2));
System.out.println("Ready");
orb.orb().run();
} catch (Exception e) {
e.printStackTrace(System.err);
System.out.println("Failed");
}
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class ORBInfoTest method test.
@Test
public void test() throws Exception {
ORB orb = ORB.getInstance("test.orb");
OA oa = OA.getRootOA(orb);
orb.initORB(new String[] {}, null);
oa.initOA(new String[] {});
System.out.println(" ORBInfo.getOrbName: " + ORBInfo.getOrbName());
System.out.println(" ORBInfo.getOrbMajorVersion: " + ORBInfo.getOrbMajorVersion());
System.out.println(" ORBInfo.getOrbMinorVersion: " + ORBInfo.getOrbMinorVersion());
System.out.println("ORBInfo.getCorbaMajorVersion: " + ORBInfo.getCorbaMajorVersion());
System.out.println("ORBInfo.getCorbaMinorVersion: " + ORBInfo.getCorbaMinorVersion());
System.out.println(" ORBInfo.getOrbEnumValue: " + ORBInfo.getOrbEnumValue());
oa.destroy();
orb.destroy();
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class ServiceTestSetup method test.
@Test
public void test() throws Exception {
/**
* Create ORB and OA *
*/
ORB testORB = ORB.getInstance(ORB_INSTANCE_NAME);
OA testOA = OA.getRootOA(testORB);
/**
* Initialise ORB and OA *
*/
testORB.initORB(new String[] {}, null);
testOA.initPOA(new String[] {});
/**
* Create services object *
*/
Services testServ = new Services(testORB);
String[] params = new String[1];
params[0] = com.arjuna.orbportability.Services.otsKind;
SimpleObjectImpl servant = new com.hp.mwtests.orbportability.orbspecific.orbinstance.SimpleObjectImpl();
testOA.objectIsReady(servant);
/*
* Register using the default mechanism.
*/
testServ.registerService(com.hp.mwtests.orbportability.orbspecific.orbtests.SimpleObjectHelper.narrow(testOA.corbaReference(servant)), TEST_SERVICE_NAME, params, Services.CONFIGURATION_FILE);
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class PropertyInitTest4 method test.
@Test
public void test() {
ORB orb = null, orb2 = null;
Map<String, String> testProps = opPropertyManager.getOrbPortabilityEnvironmentBean().getOrbInitializationProperties();
testProps.put(PreInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb"), "com.hp.mwtests.orbportability.initialisation.preinit.PreInitialisationUsingInterface");
testProps.put(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb"), "com.hp.mwtests.orbportability.initialisation.postinit.PostInitialisationUsingInterface");
testProps.put(PreInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb", ORB_INSTANCE_NAME_2), "com.hp.mwtests.orbportability.initialisation.preinit.PreInitialisationUsingInterface");
testProps.put(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb", ORB_INSTANCE_NAME_2), "com.hp.mwtests.orbportability.initialisation.postinit.PostInitialisationUsingInterface");
opPropertyManager.getOrbPortabilityEnvironmentBean().setOrbInitializationProperties(testProps);
try {
orb = ORB.getInstance(ORB_INSTANCE_NAME);
System.out.println("Initialising ORB(" + ORB_INSTANCE_NAME + ")");
orb.initORB(new String[] {}, null);
assertEquals(orb, PreInitialisationUsingInterface.getObject());
assertEquals(orb, PostInitialisationUsingInterface.getObject());
orb2 = ORB.getInstance(ORB_INSTANCE_NAME_2);
System.out.println("Initialising ORB(" + ORB_INSTANCE_NAME_2 + ")");
orb2.initORB(new String[] {}, null);
assertEquals(orb2, PreInitialisationUsingInterface.getObject());
assertEquals(orb2, PostInitialisationUsingInterface.getObject());
} catch (Exception e) {
fail("ERROR - " + e);
e.printStackTrace(System.err);
}
try {
orb.destroy();
orb2.destroy();
} catch (Exception e) {
fail("ERROR - " + e);
e.printStackTrace(System.err);
}
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class SimpleServer method test.
@Test
public void test() throws Exception {
ORB orb = ORB.getInstance("main_orb");
ORB orb2 = ORB.getInstance("main_orb_2");
RootOA oa = RootOA.getRootOA(orb);
RootOA oa2 = RootOA.getRootOA(orb2);
orb.initORB(new String[] {}, null);
oa.initOA(new String[] {});
orb2.initORB(new String[] {}, null);
oa2.initOA(new String[] {});
SimpleObjectImpl obj = new SimpleObjectImpl();
assertTrue(oa.objectIsReady(obj));
assertTrue(oa2.objectIsReady(obj));
oa.destroy();
orb.shutdown();
oa2.destroy();
orb2.shutdown();
}
Aggregations