use of com.hp.mwtests.ts.arjuna.resources.BasicRecord in project narayana by jbosstm.
the class LogStoreReactivationTest2 method test.
@Test
public void test() {
arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(LogStore.class.getName());
arjPropertyManager.getObjectStoreEnvironmentBean().setSynchronousRemoval(true);
// the byteman script will enforce this
// System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000"); // essentially infinite
AtomicAction A = new AtomicAction();
Uid txId = A.get_uid();
System.err.println("IMPORTANT: if there are warnings about USER_DEF_FIRST0 then the test has failed!");
A.begin();
A.add(new BasicRecord());
A.commit();
RecoverAtomicAction rAA = new RecoverAtomicAction(txId, ActionStatus.COMMITTED);
rAA.replayPhase2();
}
use of com.hp.mwtests.ts.arjuna.resources.BasicRecord in project narayana by jbosstm.
the class LogStressTest method run.
public void run() {
for (int i = 0; i < _iters; i++) {
try {
MyAtomicAction A = new MyAtomicAction();
A.begin();
A.add(new BasicRecord());
A.commit();
} catch (Exception e) {
e.printStackTrace();
}
Thread.yield();
}
}
use of com.hp.mwtests.ts.arjuna.resources.BasicRecord in project narayana by jbosstm.
the class LogStressTest2 method test.
@Test
public void test() {
arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(LogStore.class.getName());
arjPropertyManager.getObjectStoreEnvironmentBean().setTxLogSize(10000);
// hours
int timeLimit = 4;
System.err.println("WARNING: this test will run for " + timeLimit + " hours.");
final long stime = System.currentTimeMillis();
final long endTime = timeLimit * 60 * 60 * 1000;
long ftime;
do {
try {
AtomicAction A = new AtomicAction();
A.begin();
A.add(new BasicRecord());
A.commit();
} catch (final Exception ex) {
}
ftime = System.currentTimeMillis();
} while ((ftime - stime) < endTime);
}
use of com.hp.mwtests.ts.arjuna.resources.BasicRecord in project narayana by jbosstm.
the class LogStoreReactivationTest method test.
@Test
public void test() {
arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(LogStore.class.getName());
arjPropertyManager.getObjectStoreEnvironmentBean().setSynchronousRemoval(false);
// the byteman script will enforce this
// System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000"); // essentially infinite
AtomicAction A = new AtomicAction();
Uid txId = A.get_uid();
System.err.println("IMPORTANT: ignore warnings about USER_DEF_FIRST0 as they are expected due to BasicRecord usage!");
A.begin();
A.add(new BasicRecord());
A.commit();
RecoverAtomicAction rAA = new RecoverAtomicAction(txId, ActionStatus.COMMITTED);
rAA.replayPhase2();
}
use of com.hp.mwtests.ts.arjuna.resources.BasicRecord in project narayana by jbosstm.
the class HeuristicNotificationUnitTest method test.
@Test
public void test() throws Exception {
AtomicAction A = new AtomicAction();
DummyHeuristic dh = new DummyHeuristic();
A.begin();
A.add(new BasicRecord());
A.add(new BasicRecord());
A.add(new HeuristicRecord());
A.addSynchronization(dh);
A.commit(false);
assertEquals(TwoPhaseOutcome.HEURISTIC_MIXED, dh.getStatus());
}
Aggregations