Search in sources :

Example 6 with ORB

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");
    }
}
Also used : OA(com.arjuna.orbportability.OA) SingleResourceRegistration(org.jboss.jbossts.qa.performance.implementations.perftestwork.SingleResourceRegistration) DummyPerfTestImplementation(org.jboss.jbossts.qa.performance.implementations.perftestwork.DummyPerfTestImplementation) ORB(com.arjuna.orbportability.ORB)

Example 7 with ORB

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();
}
Also used : OA(com.arjuna.orbportability.OA) ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Example 8 with ORB

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);
}
Also used : Services(com.arjuna.orbportability.Services) OA(com.arjuna.orbportability.OA) SimpleObjectImpl(com.hp.mwtests.orbportability.orbspecific.orbinstance.SimpleObjectImpl) ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Example 9 with ORB

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);
    }
}
Also used : ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Example 10 with ORB

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();
}
Also used : RootOA(com.arjuna.orbportability.RootOA) ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Aggregations

ORB (com.arjuna.orbportability.ORB)93 RootOA (com.arjuna.orbportability.RootOA)71 Test (org.junit.Test)57 OA (com.arjuna.orbportability.OA)20 ServerORB (com.hp.mwtests.ts.jts.utils.ServerORB)20 Control (org.omg.CosTransactions.Control)20 Services (com.arjuna.orbportability.Services)19 CurrentImple (com.arjuna.ats.internal.jts.orbspecific.CurrentImple)9 PerfTestInterface (org.jboss.jbossts.qa.performance.PerfTestInterface)7 SystemException (org.omg.CORBA.SystemException)7 IntHolder (org.omg.CORBA.IntHolder)6 Coordinator (org.omg.CosTransactions.Coordinator)6 UserException (org.omg.CORBA.UserException)5 Properties (java.util.Properties)4 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)4 Terminator (org.omg.CosTransactions.Terminator)4 AtomicObject (com.hp.mwtests.ts.jts.orbspecific.resources.AtomicObject)3 Status (org.omg.CosTransactions.Status)3 TransactionFactory (org.omg.CosTransactions.TransactionFactory)3 TransactionFactoryImple (com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple)2