Search in sources :

Example 11 with ServerORB

use of com.hp.mwtests.ts.jts.utils.ServerORB in project narayana by jbosstm.

the class SetGetServer method main.

public static void main(String[] args) throws Exception {
    ServerORB orb = new ServerORB();
    ORB myORB = orb.getORB();
    RootOA myOA = orb.getOA();
    String refFile = args[0];
    setget_i impl = new setget_i();
    Services serv = new Services(myORB);
    try {
        TestUtility.registerService(refFile, myORB.orb().object_to_string(impl.getReference()));
        System.out.println("Ready");
        myOA.run();
    } catch (Exception e) {
        TestUtility.fail("SetGetServer caught exception: " + e);
    }
    myOA.shutdownObject(impl);
    System.out.println("**Object server exiting**");
}
Also used : ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) Services(com.arjuna.orbportability.Services) com.hp.mwtests.ts.jts.orbspecific.resources.setget_i(com.hp.mwtests.ts.jts.orbspecific.resources.setget_i) RootOA(com.arjuna.orbportability.RootOA) ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) ORB(com.arjuna.orbportability.ORB)

Example 12 with ServerORB

use of com.hp.mwtests.ts.jts.utils.ServerORB in project narayana by jbosstm.

the class ImplicitArjunaClient method main.

public static void main(String[] args) throws Exception {
    ServerORB orb = new ServerORB();
    ORB myORB = orb.getORB();
    RootOA myOA = orb.getOA();
    String refFile = args[0];
    CurrentImple current = OTSImpleManager.current();
    // pointer the grid object that will be used.
    stack stackVar = null;
    try {
        current.begin();
        try {
            Services serv = new Services(myORB);
            stackVar = stackHelper.narrow(myORB.orb().string_to_object(TestUtility.getService(refFile)));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            TestUtility.fail(e.toString());
        }
        System.out.println("pushing 1 onto stack");
        stackVar.push(1);
        System.out.println("pushing 2 onto stack");
        stackVar.push(2);
    } catch (Exception e) {
        e.printStackTrace(System.err);
        TestUtility.fail(e.toString());
    }
    try {
        current.commit(false);
        current.begin();
        IntHolder val = new IntHolder(-1);
        if (stackVar.pop(val) == 0) {
            System.out.println("popped top of stack " + val.value);
            current.begin();
            stackVar.push(3);
            System.out.println("pushed 3 onto stack. Aborting nested action.");
            current.rollback();
            stackVar.pop(val);
            System.out.println("popped top of stack is " + val.value);
            current.commit(false);
            TestUtility.assertEquals(1, val.value);
        } else {
            TestUtility.fail("Error getting stack value.");
            current.rollback();
        }
    } catch (Exception e) {
        e.printStackTrace(System.err);
        TestUtility.fail(e.toString());
    }
    myOA.destroy();
    myORB.shutdown();
    System.out.println("Passed");
}
Also used : ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) Services(com.arjuna.orbportability.Services) TestModule.stack(com.hp.mwtests.ts.jts.TestModule.stack) IntHolder(org.omg.CORBA.IntHolder) RootOA(com.arjuna.orbportability.RootOA) CurrentImple(com.arjuna.ats.internal.jts.orbspecific.CurrentImple) ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) ORB(com.arjuna.orbportability.ORB)

Example 13 with ServerORB

use of com.hp.mwtests.ts.jts.utils.ServerORB in project narayana by jbosstm.

the class PerfHammer method main.

public static void main(String[] args) throws Exception {
    String gridReference = args[0];
    int numberOfCalls = 1000;
    int threadCount = 10;
    int batchSize = 100;
    int warmUpCount = 0;
    ServerORB orb = new ServerORB();
    ORB myORB = orb.getORB();
    RootOA myOA = orb.getOA();
    String metricName = "JTSRemote_PerfTest_PerfHammer_" + System.getProperty("org.omg.CORBA.ORBClass", myORB.orb().getClass().getName());
    GridWorker worker = new GridWorker(myORB, gridReference);
    Measurement measurement = new Measurement.Builder(metricName).maxTestTime(0L).numberOfCalls(numberOfCalls).numberOfThreads(threadCount).batchSize(batchSize).numberOfWarmupCalls(warmUpCount).build().measure(worker, worker);
    System.out.printf("%s: %d iterations using %d threads with a batch size of %d%n", metricName, numberOfCalls, threadCount, batchSize);
    System.out.printf("%s%n", measurement.getInfo());
    System.out.printf("%s%n%s%n", measurement.getInfo(), (measurement.shouldFail() || measurement.getNumberOfErrors() != 0 ? "Failed" : "Passed"));
}
Also used : Measurement(io.narayana.perf.Measurement) ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) RootOA(com.arjuna.orbportability.RootOA) ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) ORB(com.arjuna.orbportability.ORB)

Example 14 with ServerORB

use of com.hp.mwtests.ts.jts.utils.ServerORB in project narayana by jbosstm.

the class GridServer method main.

public static void main(String[] args) throws Exception {
    ServerORB orb = new ServerORB();
    ORB myORB = orb.getORB();
    RootOA myOA = orb.getOA();
    String gridReference = args[0];
    grid_i myGrid = new grid_i(100, 100);
    Services serv = new Services(myORB);
    try {
        TestUtility.registerService(gridReference, myORB.orb().object_to_string(myGrid.getReference()));
        System.out.println("Ready");
        myOA.run();
    } catch (Exception e) {
        TestUtility.fail("**GridServer caught exception: " + e);
    }
    myOA.shutdownObject(myGrid);
    System.out.println("**Grid server exiting**");
}
Also used : ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) Services(com.arjuna.orbportability.Services) RootOA(com.arjuna.orbportability.RootOA) com.hp.mwtests.ts.jts.orbspecific.resources.grid_i(com.hp.mwtests.ts.jts.orbspecific.resources.grid_i) ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) ORB(com.arjuna.orbportability.ORB)

Example 15 with ServerORB

use of com.hp.mwtests.ts.jts.utils.ServerORB in project narayana by jbosstm.

the class StackServer method main.

public static void main(String[] args) throws Exception {
    ServerORB orb = new ServerORB();
    ORB myORB = orb.getORB();
    RootOA myOA = orb.getOA();
    String refFile = args[0];
    stackPOATie theStack = new stackPOATie(new StackImple());
    myOA.objectIsReady(theStack);
    Services serv = new Services(myORB);
    try {
        TestUtility.registerService(refFile, myORB.orb().object_to_string(stackHelper.narrow(myOA.corbaReference(theStack))));
        System.out.println("Ready");
        myOA.run();
    } catch (Exception e) {
        TestUtility.fail("StackServer caught exception: " + e);
    }
    myOA.shutdownObject(theStack);
    System.out.println("**StackServer exiting**");
}
Also used : ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) Services(com.arjuna.orbportability.Services) StackImple(com.hp.mwtests.ts.jts.orbspecific.resources.StackImple) RootOA(com.arjuna.orbportability.RootOA) TestModule.stackPOATie(com.hp.mwtests.ts.jts.TestModule.stackPOATie) ServerORB(com.hp.mwtests.ts.jts.utils.ServerORB) ORB(com.arjuna.orbportability.ORB)

Aggregations

ORB (com.arjuna.orbportability.ORB)20 RootOA (com.arjuna.orbportability.RootOA)20 ServerORB (com.hp.mwtests.ts.jts.utils.ServerORB)20 Services (com.arjuna.orbportability.Services)16 CurrentImple (com.arjuna.ats.internal.jts.orbspecific.CurrentImple)6 Control (org.omg.CosTransactions.Control)6 IntHolder (org.omg.CORBA.IntHolder)5 Test (org.junit.Test)4 SetGet (com.hp.mwtests.ts.jts.TestModule.SetGet)2 com.hp.mwtests.ts.jts.orbspecific.resources.trangrid_i (com.hp.mwtests.ts.jts.orbspecific.resources.trangrid_i)2 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)2 ExplicitStack (com.hp.mwtests.ts.jts.TestModule.ExplicitStack)1 ExplicitStackPOATie (com.hp.mwtests.ts.jts.TestModule.ExplicitStackPOATie)1 HammerPOATie (com.hp.mwtests.ts.jts.TestModule.HammerPOATie)1 TranGrid (com.hp.mwtests.ts.jts.TestModule.TranGrid)1 TestModule.grid (com.hp.mwtests.ts.jts.TestModule.grid)1 TestModule.stack (com.hp.mwtests.ts.jts.TestModule.stack)1 TestModule.stackPOATie (com.hp.mwtests.ts.jts.TestModule.stackPOATie)1 DHThreadObject2 (com.hp.mwtests.ts.jts.orbspecific.resources.DHThreadObject2)1 DHThreadObject3b (com.hp.mwtests.ts.jts.orbspecific.resources.DHThreadObject3b)1