Search in sources :

Example 1 with Service01

use of org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01 in project narayana by jbosstm.

the class RestoreClient001a method Test.

public void Test() {
    try {
        setNumberOfCalls(3);
        setNumberOfResources(2);
        setUniquePrefix(1);
        Service01 mService = new Service01(mNumberOfResources);
        // restore objects from uid's
        mService.restoreUIDs(getUniquePrefix());
        // check if objects and final values have been restored.
        mCorrect = mService.checkRestore();
        mService.clearUIDs(getUniquePrefix());
        qaAssert(mCorrect);
    } catch (Exception e) {
        Fail("Error in RestoreClient001a.test() :", e);
    }
}
Also used : Service01(org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01)

Example 2 with Service01

use of org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01 in project narayana by jbosstm.

the class Worker001 method run.

/**
 * The main method of the class that will perform the work.
 */
public void run() {
    try {
        AtomicAction a = new AtomicAction();
        // start transaction
        a.begin();
        mService.setupOper();
        mService.doWork(mMaxIteration);
        // comit transaction
        a.commit();
        mService = new Service01(mNumberOfResources);
        // start new AtomicAction
        AtomicAction b = new AtomicAction();
        b.begin();
        mService.setupOper();
        mService.doWork(mMaxIteration);
        b.abort();
    } catch (Exception e) {
        mCorrect = false;
        qautil.debug("exception in worker001: ", e);
    }
}
Also used : AtomicAction(com.arjuna.ats.arjuna.AtomicAction) Service01(org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01)

Example 3 with Service01

use of org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01 in project narayana by jbosstm.

the class RestoreClient001b method Test.

public void Test() {
    try {
        setNumberOfCalls(3);
        setNumberOfResources(2);
        setUniquePrefix(1);
        Service01 mService = new Service01(mNumberOfResources);
        startTx();
        mService.setupOper();
        mService.doWork(mMaxIteration);
        // comit transaction
        commit();
        mService.storeUIDs(getUniquePrefix());
        qaAssert(mCorrect);
    } catch (Exception e) {
        Fail("Error in RestoreClient001b.test() :", e);
    }
}
Also used : Service01(org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01)

Example 4 with Service01

use of org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01 in project narayana by jbosstm.

the class Client002 method Test.

public void Test() {
    try {
        setNumberOfCalls(2);
        setNumberOfResources(1);
        Service01 mService = new Service01(mNumberOfResources);
        startTx();
        mService.setupOper(true);
        mService.doWork(mMaxIteration);
        commit();
        mCorrect = mService.checkCommitOper();
        mService = new Service01(mNumberOfResources);
        startTx();
        mService.setupOper(true);
        mService.doWork(mMaxIteration);
        abort();
        // check final values
        mCorrect = mCorrect && mService.checkAbortOper();
        qaAssert(mCorrect);
    } catch (Exception e) {
        Fail("Error in Client002.test() :", e);
    }
}
Also used : Service01(org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01)

Example 5 with Service01

use of org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01 in project narayana by jbosstm.

the class MemoryClient002 method Test.

public void Test() {
    try {
        setNumberOfCalls(3);
        setNumberOfResources(2);
        getClientThreshold(1);
        Service01 mService = new Service01(mNumberOfResources);
        startTx();
        mService.setupOper(true);
        mService.doWork(mMaxIteration);
        commit();
        // get first memory reading.
        getFirstReading();
        mService = new Service01(mNumberOfResources);
        startTx();
        mService.setupOper(true);
        mService.doWork(mMaxIteration);
        abort();
        getSecondReading();
        qaMemoryAssert();
    } catch (Exception e) {
        Fail("Error in MemoryClient002.test() :", e);
    }
}
Also used : Service01(org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01)

Aggregations

Service01 (org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.Service01)10 AtomicAction (com.arjuna.ats.arjuna.AtomicAction)2 TxStats (com.arjuna.ats.arjuna.coordinator.TxStats)2 BasicAbstractRecord (org.jboss.jbossts.qa.ArjunaCore.AbstractRecord.impl.BasicAbstractRecord)1