Search in sources :

Example 1 with SynchronizationImple

use of com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple in project narayana by jbosstm.

the class SynchronizationUnitTest method testValid.

@Test
public void testValid() {
    SynchronizationImple sync = new SynchronizationImple(new Synchronization());
    assertTrue(sync.get_uid().notEquals(Uid.nullUid()));
    assertTrue(sync.beforeCompletion());
    assertTrue(sync.afterCompletion(Status.STATUS_COMMITTED));
    SynchronizationImple comp = new SynchronizationImple(new Synchronization());
    assertTrue(comp.compareTo(sync) != 0);
    assertTrue(sync.toString() != null);
}
Also used : Synchronization(com.hp.mwtests.ts.jta.common.Synchronization) SynchronizationImple(com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple) Test(org.junit.Test)

Example 2 with SynchronizationImple

use of com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple in project narayana by jbosstm.

the class SynchronizationUnitTest method testInvalid.

@Test
public void testInvalid() {
    SynchronizationImple sync = new SynchronizationImple(null);
    assertTrue(sync.get_uid().notEquals(Uid.nullUid()));
    assertFalse(sync.beforeCompletion());
    assertFalse(sync.afterCompletion(Status.STATUS_COMMITTED));
}
Also used : SynchronizationImple(com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple) Test(org.junit.Test)

Aggregations

SynchronizationImple (com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple)2 Test (org.junit.Test)2 Synchronization (com.hp.mwtests.ts.jta.common.Synchronization)1