use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test05 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.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("Test05.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test05.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test07 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();
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("Test07.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test07.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test09 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(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("Test09.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test09.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test16 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.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("Test16.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test16.main: " + exception);
exception.printStackTrace(System.err);
}
}
use of org.omg.CosTransactions.Current in project narayana by jbosstm.
the class Test18 method main.
public static void main(String[] args) {
try {
ORBInterface.initORB(args, null);
OAInterface.initOA();
boolean correct = true;
int numberOfTransactionNames = 1000;
Current current = OTS.get_current();
String[] transactionNames = new String[numberOfTransactionNames];
for (int index = 0; index < numberOfTransactionNames; index++) {
current.begin();
transactionNames[index] = current.get_transaction_name();
current.commit(false);
}
for (int index1 = 0; index1 < numberOfTransactionNames - 1; index1++) {
for (int index2 = index1 + 1; index2 < numberOfTransactionNames; index2++) {
correct = correct && (!transactionNames[index1].equals(transactionNames[index2]));
}
}
if (correct) {
System.out.println("Passed");
} else {
System.out.println("Failed");
}
} catch (Exception exception) {
System.out.println("Failed");
System.err.println("Test18.main: " + exception);
exception.printStackTrace(System.err);
}
try {
OAInterface.shutdownOA();
ORBInterface.shutdownORB();
} catch (Exception exception) {
System.err.println("Test18.main: " + exception);
exception.printStackTrace(System.err);
}
}
Aggregations