Search in sources :

Example 1 with RecoveryDriver

use of com.arjuna.ats.arjuna.recovery.RecoveryDriver in project narayana by jbosstm.

the class RecoveryDriverUnitTest method testInvalid.

@Test
public void testInvalid() throws Exception {
    RecoveryDriver rd = new RecoveryDriver(0, "foobar");
    try {
        rd.asynchronousScan();
        fail();
    } catch (final Exception ex) {
    }
    try {
        rd.synchronousScan();
        fail();
    } catch (final Exception ex) {
    }
}
Also used : RecoveryDriver(com.arjuna.ats.arjuna.recovery.RecoveryDriver) Test(org.junit.Test)

Example 2 with RecoveryDriver

use of com.arjuna.ats.arjuna.recovery.RecoveryDriver in project narayana by jbosstm.

the class RecoveryDriverUnitTest method testValid.

@Test
public void testValid() throws Exception {
    recoveryPropertyManager.getRecoveryEnvironmentBean().setPeriodicRecoveryPeriod(1);
    recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
    RecoveryManager rm = RecoveryManager.manager();
    rm.scan(null);
    RecoveryDriver rd = new RecoveryDriver(RecoveryManager.getRecoveryManagerPort(), recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryAddress(), 100000);
    assertTrue(rd.asynchronousScan());
    assertTrue(rd.synchronousScan());
}
Also used : RecoveryManager(com.arjuna.ats.arjuna.recovery.RecoveryManager) RecoveryDriver(com.arjuna.ats.arjuna.recovery.RecoveryDriver) Test(org.junit.Test)

Aggregations

RecoveryDriver (com.arjuna.ats.arjuna.recovery.RecoveryDriver)2 Test (org.junit.Test)2 RecoveryManager (com.arjuna.ats.arjuna.recovery.RecoveryManager)1