Search in sources :

Example 1 with RemoteImpl

use of com.arjuna.ats.jtax.tests.implicit.impl.RemoteImpl 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)

Aggregations

RemoteImpl (com.arjuna.ats.jtax.tests.implicit.impl.RemoteImpl)1 OA (com.arjuna.orbportability.OA)1 ORB (com.arjuna.orbportability.ORB)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1 Test (org.junit.Test)1