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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations