Search in sources :

Example 1 with Current

use of org.omg.CosTransactions.Current in project narayana by jbosstm.

the class Test03 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        try {
            current.rollback();
            correct = false;
        } catch (NoTransaction noTransaction) {
        }
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test03.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test03.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 2 with Current

use of org.omg.CosTransactions.Current in project narayana by jbosstm.

the class Test33 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        current.begin();
        correct = (current.get_status() == Status.StatusActive);
        current.commit(true);
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test33.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test33.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : Current(org.omg.CosTransactions.Current)

Example 3 with Current

use of org.omg.CosTransactions.Current in project narayana by jbosstm.

the class Test11 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        current.begin();
        current.commit(false);
        try {
            current.rollback();
            correct = false;
        } catch (NoTransaction noTransaction) {
        }
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test11.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test11.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 4 with Current

use of org.omg.CosTransactions.Current in project narayana by jbosstm.

the class Test13 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        current.begin();
        current.rollback();
        try {
            current.commit(true);
            correct = false;
        } catch (NoTransaction noTransaction) {
        }
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test13.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test13.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 5 with Current

use of org.omg.CosTransactions.Current in project narayana by jbosstm.

the class Test23 method main.

public static void main(String[] args) {
    try {
        ORBInterface.initORB(args, null);
        OAInterface.initOA();
        boolean correct = true;
        Current current = OTS.get_current();
        current.begin();
        current.commit(false);
        Control control = current.suspend();
        correct = (control == null);
        if (correct) {
            System.out.println("Passed");
        } else {
            System.out.println("Failed");
        }
    } catch (Exception exception) {
        System.out.println("Failed");
        System.err.println("Test23.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test23.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : Control(org.omg.CosTransactions.Control) Current(org.omg.CosTransactions.Current)

Aggregations

Current (org.omg.CosTransactions.Current)37 NoTransaction (org.omg.CosTransactions.NoTransaction)17 Control (org.omg.CosTransactions.Control)9 InvalidControl (org.omg.CosTransactions.InvalidControl)4 ORB (com.arjuna.orbportability.ORB)2 RootOA (com.arjuna.orbportability.RootOA)2 com.hp.mwtests.ts.jts.orbspecific.resources.heuristic (com.hp.mwtests.ts.jts.orbspecific.resources.heuristic)2 Test (org.junit.Test)2 AtomicResource (com.hp.mwtests.ts.jts.orbspecific.resources.AtomicResource)1 DemoResource (com.hp.mwtests.ts.jts.orbspecific.resources.DemoResource)1 ResourceTrace (com.hp.mwtests.ts.jts.utils.ResourceTrace)1 ServerORB (com.hp.mwtests.ts.jts.utils.ServerORB)1 SystemException (org.omg.CORBA.SystemException)1 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)1 Coordinator (org.omg.CosTransactions.Coordinator)1 HeuristicHazard (org.omg.CosTransactions.HeuristicHazard)1 HeuristicMixed (org.omg.CosTransactions.HeuristicMixed)1 Resource (org.omg.CosTransactions.Resource)1 Status (org.omg.CosTransactions.Status)1