use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test24 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();
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("Test24.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test24.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test26 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();
Control control = current.get_control();
current.commit(true);
try {
current.resume(control);
} catch (InvalidControl invalidControl) {
System.err.println("Failed to resume committed transaction!");
correct = false;
}
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Test26.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test26.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test28 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();
Control control = current.get_control();
current.rollback();
try {
current.resume(control);
} catch (InvalidControl invalidControl) {
System.err.println("Failed to resume rolled-back transaction!");
correct = false;
}
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Test28.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test28.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test32 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();
correct = (current.get_status() == Status.StatusNoTransaction);
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Test32.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test32.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test02 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(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("Test02.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test02.main: " + exception);
exception.printStackTrace(System.err);
}
}
Aggregations