Search in sources :

Example 16 with Current

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

the class Test04 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_only();
            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("Test04.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test04.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 17 with Current

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

the class Test08 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(true);
        try {
            current.rollback_only();
            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("Test08.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test08.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 18 with Current

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

the class Test10 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.commit(false);
            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("Test10.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test10.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 19 with Current

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

the class Test12 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_only();
            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("Test12.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test12.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) Current(org.omg.CosTransactions.Current)

Example 20 with Current

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

the class Test01 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.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("Test01.main: " + exception);
        exception.printStackTrace(System.err);
    }
    try {
        OAInterface.shutdownOA();
        ORBInterface.shutdownORB();
    } catch (Exception exception) {
        System.err.println("Test01.main: " + exception);
        exception.printStackTrace(System.err);
    }
}
Also used : NoTransaction(org.omg.CosTransactions.NoTransaction) 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