Search in sources :

Example 1 with PerfTestInterface

use of org.jboss.jbossts.qa.performance.PerfTestInterface in project narayana by jbosstm.

the class NestedTwoPhaseTrx method work.

protected void work() throws Exception {
    try {
        ORB orb = ORB.getInstance(PerformanceFramework.ORB_INSTANCE_NAME);
        OA oa = OA.getRootOA(orb);
        String ref1 = getServiceConfig(0);
        String ref2 = getServiceConfig(1);
        org.omg.CORBA.Object obj1 = orb.orb().string_to_object(ref1);
        PerfTestInterface d1 = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj1);
        OTSManager.get_current().begin();
        d1.work();
        org.omg.CORBA.Object obj2 = orb.orb().string_to_object(ref2);
        PerfTestInterface d2 = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj2);
        OTSManager.get_current().begin();
        d2.work();
        if (isParameterDefined("-commit")) {
            // nested commit
            OTSManager.get_current().commit(true);
            // top level commit
            OTSManager.get_current().commit(true);
        } else {
            // nested rollback
            OTSManager.get_current().rollback();
            // top level rollback
            OTSManager.get_current().rollback();
        }
    } catch (Exception e) {
        System.err.println("Unexpected exception: " + e);
        e.printStackTrace(System.err);
    }
}
Also used : OA(com.arjuna.orbportability.OA) PerfTestInterface(org.jboss.jbossts.qa.performance.PerfTestInterface) ORB(com.arjuna.orbportability.ORB)

Example 2 with PerfTestInterface

use of org.jboss.jbossts.qa.performance.PerfTestInterface in project narayana by jbosstm.

the class TwoPhaseTrx method work.

protected void work() throws Exception {
    try {
        ORB orb = ORB.getInstance(PerformanceFramework.ORB_INSTANCE_NAME);
        OA oa = OA.getRootOA(orb);
        String ref1 = getServiceConfig(0);
        String ref2 = getServiceConfig(1);
        org.omg.CORBA.Object obj1 = orb.orb().string_to_object(ref1);
        PerfTestInterface d1 = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj1);
        OTSManager.get_current().begin();
        d1.work();
        org.omg.CORBA.Object obj2 = orb.orb().string_to_object(ref2);
        PerfTestInterface d2 = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj2);
        d2.work();
        if (isParameterDefined("-commit")) {
            // top level commit
            OTSManager.get_current().commit(true);
        } else {
            // top level rollback
            OTSManager.get_current().rollback();
        }
    } catch (Exception e) {
        System.err.println("Unexpected Exception: " + e);
        e.printStackTrace(System.err);
    }
}
Also used : OA(com.arjuna.orbportability.OA) PerfTestInterface(org.jboss.jbossts.qa.performance.PerfTestInterface) ORB(com.arjuna.orbportability.ORB)

Example 3 with PerfTestInterface

use of org.jboss.jbossts.qa.performance.PerfTestInterface in project narayana by jbosstm.

the class DummyImplServer 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);
        DummyPerfTestImplementation obj1 = new DummyPerfTestImplementation();
        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) DummyPerfTestImplementation(org.jboss.jbossts.qa.performance.implementations.perftestwork.DummyPerfTestImplementation) PerfTestInterface(org.jboss.jbossts.qa.performance.PerfTestInterface) ORB(com.arjuna.orbportability.ORB)

Example 4 with PerfTestInterface

use of org.jboss.jbossts.qa.performance.PerfTestInterface in project narayana by jbosstm.

the class NestedOnePhaseTrx method work.

protected void work() throws Exception {
    ORB orb = ORB.getInstance(PerformanceFramework.ORB_INSTANCE_NAME);
    OA oa = OA.getRootOA(orb);
    String ref1 = getServiceConfig(0);
    String ref2 = getServiceConfig(1);
    org.omg.CORBA.Object obj1 = orb.orb().string_to_object(ref1);
    PerfTestInterface d1 = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj1);
    OTSManager.get_current().begin();
    d1.work();
    org.omg.CORBA.Object obj2 = orb.orb().string_to_object(ref2);
    PerfTestInterface d2 = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj2);
    OTSManager.get_current().begin();
    d2.work();
    // nested commit
    OTSManager.get_current().commit(true);
    if (true) {
        // top level commit
        OTSManager.get_current().commit(true);
    } else {
        // top level rollback
        OTSManager.get_current().rollback();
    }
}
Also used : OA(com.arjuna.orbportability.OA) PerfTestInterface(org.jboss.jbossts.qa.performance.PerfTestInterface) ORB(com.arjuna.orbportability.ORB)

Example 5 with PerfTestInterface

use of org.jboss.jbossts.qa.performance.PerfTestInterface in project narayana by jbosstm.

the class OnePhaseTrx method work.

protected void work() throws Exception {
    try {
        ORB orb = ORB.getInstance(PerformanceFramework.ORB_INSTANCE_NAME);
        OA oa = OA.getRootOA(orb);
        String ref1 = getServiceConfig(0);
        org.omg.CORBA.Object obj = orb.orb().string_to_object(ref1);
        PerfTestInterface d = (PerfTestInterface) PerfTestInterfaceHelper.narrow(obj);
        OTSManager.get_current().begin();
        d.work();
        if (isParameterDefined("-commit"))
            OTSManager.get_current().commit(true);
        else
            OTSManager.get_current().rollback();
    } catch (Exception e) {
        System.err.println("Unexpected exception: " + e);
        e.printStackTrace(System.err);
    }
}
Also used : OA(com.arjuna.orbportability.OA) PerfTestInterface(org.jboss.jbossts.qa.performance.PerfTestInterface) ORB(com.arjuna.orbportability.ORB)

Aggregations

OA (com.arjuna.orbportability.OA)7 ORB (com.arjuna.orbportability.ORB)7 PerfTestInterface (org.jboss.jbossts.qa.performance.PerfTestInterface)7 DummyPerfTestImplementation (org.jboss.jbossts.qa.performance.implementations.perftestwork.DummyPerfTestImplementation)1 SingleResourceRegistration (org.jboss.jbossts.qa.performance.implementations.perftestwork.SingleResourceRegistration)1 SingleSubtranAwareResourceRegistration (org.jboss.jbossts.qa.performance.implementations.perftestwork.SingleSubtranAwareResourceRegistration)1