use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class ImplicitServer method test.
@Test
public void test() throws Exception {
jtaPropertyManager.getJTAEnvironmentBean().setTransactionManagerClassName(com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.class.getName());
jtaPropertyManager.getJTAEnvironmentBean().setUserTransactionClassName(com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple.class.getName());
ORB orb = ORB.getInstance("implicitserver-orb");
OA oa = OA.getRootOA(orb);
orb.initORB(new String[] {}, null);
oa.initPOA(new String[] {});
RemoteImpl impl = new RemoteImpl();
oa.objectIsReady(impl);
org.omg.CORBA.Object obj = oa.corbaReference(impl);
File file = new File("server.ior");
file.delete();
file.createNewFile();
FileWriter fileWriter = new FileWriter(file);
fileWriter.write(orb.orb().object_to_string(obj));
fileWriter.close();
// TODO registerService(args[0], orb.orb().object_to_string(obj));
orb.orb().run();
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class JCAServerTransactionRecoveryModuleTest method tearDown.
@After
public void tearDown() {
RecoveryManager.manager().terminate();
ORB myORB = ORB.getInstance("test");
RootOA myOA = OA.getRootOA(myORB);
myOA.destroy();
myORB.shutdown();
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class JCAServerTransactionRecoveryModuleTest method setup.
@Before
public void setup() throws InvalidName {
ORB myORB = ORB.getInstance("test");
RootOA myOA = OA.getRootOA(myORB);
myORB.initORB(new String[0], null);
myOA.initOA();
com.arjuna.ats.internal.jts.ORBManager.setORB(myORB);
com.arjuna.ats.internal.jts.ORBManager.setPOA(myOA);
RecoveryManager.manager().initialize();
Implementationsx.initialise();
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class SimpleNestedTest method testEnabled.
@Test
public void testEnabled() throws Exception {
ORB myORB = null;
RootOA myOA = null;
myORB = ORB.getInstance("test");
myOA = OA.getRootOA(myORB);
myORB.initORB(new String[] {}, null);
myOA.initOA();
ORBManager.setORB(myORB);
ORBManager.setPOA(myOA);
jtaPropertyManager.getJTAEnvironmentBean().setTransactionManagerClassName(com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.class.getName());
jtaPropertyManager.getJTAEnvironmentBean().setUserTransactionClassName(com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple.class.getName());
jtaPropertyManager.getJTAEnvironmentBean().setSupportSubtransactions(true);
javax.transaction.TransactionManager transactionManager = com.arjuna.ats.jta.TransactionManager.transactionManager();
transactionManager.begin();
transactionManager.begin();
transactionManager.commit();
transactionManager.commit();
myOA.destroy();
myORB.shutdown();
}
use of com.arjuna.orbportability.ORB in project narayana by jbosstm.
the class NullResource method test.
@Test
public void test() throws Exception {
ORB myORB = null;
RootOA myOA = null;
myORB = ORB.getInstance("test");
myOA = OA.getRootOA(myORB);
myORB.initORB(new String[] {}, null);
myOA.initOA();
ORBManager.setORB(myORB);
ORBManager.setPOA(myOA);
jtaPropertyManager.getJTAEnvironmentBean().setTransactionManagerClassName(com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.class.getName());
jtaPropertyManager.getJTAEnvironmentBean().setUserTransactionClassName(com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple.class.getName());
boolean passed = false;
try {
for (int i = 0; i < 1000; i++) {
javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
tm.begin();
tm.getTransaction().rollback();
tm.suspend();
}
passed = true;
} catch (Exception e) {
e.printStackTrace();
fail();
}
assertTrue(passed);
myOA.destroy();
myORB.shutdown();
}
Aggregations