Search in sources :

Example 1 with RecoverableObject

use of com.hp.mwtests.ts.txoj.common.resources.RecoverableObject in project narayana by jbosstm.

the class PerformanceTest2 method recoverableTest.

@Test
public void recoverableTest() {
    long iters = 1000;
    RecoverableObject foo = new RecoverableObject();
    AtomicAction A = null;
    long t1 = System.currentTimeMillis();
    for (int c = 0; c < iters; c++) {
        A = new AtomicAction();
        A.begin();
        foo.set(2);
        A.commit();
    }
    reportThroughput("recoverableTest", iters, t1);
}
Also used : RecoverableObject(com.hp.mwtests.ts.txoj.common.resources.RecoverableObject) AtomicAction(com.arjuna.ats.arjuna.AtomicAction) Test(org.junit.Test)

Example 2 with RecoverableObject

use of com.hp.mwtests.ts.txoj.common.resources.RecoverableObject in project narayana by jbosstm.

the class PerformanceTest1 method recoverableTest.

@Test
public void recoverableTest() {
    long iters = 4;
    RecoverableObject foo = new RecoverableObject();
    AtomicAction A = new AtomicAction();
    long t1 = System.currentTimeMillis();
    A.begin();
    for (int c = 0; c < iters; c++) {
        foo.set(2);
    }
    A.commit();
    reportThroughput("recoverableTest", iters, t1);
}
Also used : RecoverableObject(com.hp.mwtests.ts.txoj.common.resources.RecoverableObject) AtomicAction(com.arjuna.ats.arjuna.AtomicAction) Test(org.junit.Test)

Example 3 with RecoverableObject

use of com.hp.mwtests.ts.txoj.common.resources.RecoverableObject in project narayana by jbosstm.

the class RecoverableTest method test.

@Test
public void test() {
    RecoverableObject foo = new RecoverableObject();
    AtomicAction A = new AtomicAction();
    A.begin();
    foo.set(2);
    assertEquals(2, foo.get());
    A.abort();
    assertEquals(0, foo.get());
    AtomicAction B = new AtomicAction();
    B.begin();
    foo.set(4);
    assertEquals(4, foo.get());
    B.commit();
    assertEquals(4, foo.get());
}
Also used : RecoverableObject(com.hp.mwtests.ts.txoj.common.resources.RecoverableObject) AtomicAction(com.arjuna.ats.arjuna.AtomicAction) Test(org.junit.Test)

Aggregations

AtomicAction (com.arjuna.ats.arjuna.AtomicAction)3 RecoverableObject (com.hp.mwtests.ts.txoj.common.resources.RecoverableObject)3 Test (org.junit.Test)3