Search in sources :

Example 51 with ORB

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();
}
Also used : FileWriter(java.io.FileWriter) OA(com.arjuna.orbportability.OA) RemoteImpl(com.arjuna.ats.jtax.tests.implicit.impl.RemoteImpl) File(java.io.File) ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Example 52 with ORB

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();
}
Also used : RootOA(com.arjuna.orbportability.RootOA) ORB(com.arjuna.orbportability.ORB) After(org.junit.After)

Example 53 with ORB

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();
}
Also used : RootOA(com.arjuna.orbportability.RootOA) ORB(com.arjuna.orbportability.ORB) Before(org.junit.Before)

Example 54 with ORB

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();
}
Also used : RootOA(com.arjuna.orbportability.RootOA) ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Example 55 with ORB

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();
}
Also used : RootOA(com.arjuna.orbportability.RootOA) ORB(com.arjuna.orbportability.ORB) Test(org.junit.Test)

Aggregations

ORB (com.arjuna.orbportability.ORB)93 RootOA (com.arjuna.orbportability.RootOA)71 Test (org.junit.Test)57 OA (com.arjuna.orbportability.OA)20 ServerORB (com.hp.mwtests.ts.jts.utils.ServerORB)20 Control (org.omg.CosTransactions.Control)20 Services (com.arjuna.orbportability.Services)19 CurrentImple (com.arjuna.ats.internal.jts.orbspecific.CurrentImple)9 PerfTestInterface (org.jboss.jbossts.qa.performance.PerfTestInterface)7 SystemException (org.omg.CORBA.SystemException)7 IntHolder (org.omg.CORBA.IntHolder)6 Coordinator (org.omg.CosTransactions.Coordinator)6 UserException (org.omg.CORBA.UserException)5 Properties (java.util.Properties)4 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)4 Terminator (org.omg.CosTransactions.Terminator)4 AtomicObject (com.hp.mwtests.ts.jts.orbspecific.resources.AtomicObject)3 Status (org.omg.CosTransactions.Status)3 TransactionFactory (org.omg.CosTransactions.TransactionFactory)3 TransactionFactoryImple (com.arjuna.ats.internal.jts.orbspecific.TransactionFactoryImple)2