use of com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean in project narayana by jbosstm.
the class ObjectStoreTest method testActionStore.
@Test
public void testActionStore() throws Exception {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot("tmp");
ActionStore as = new ActionStore(objectStoreEnvironmentBean);
final OutputObjectState buff = new OutputObjectState();
final String tn = "/StateManager/junit";
for (int i = 0; i < 100; i++) {
Uid u = new Uid();
as.write_uncommitted(u, tn, buff);
as.commit_state(u, tn);
assertTrue(as.currentState(u, tn) != StateStatus.OS_UNCOMMITTED);
InputObjectState ios = new InputObjectState();
as.allObjUids("", ios);
assertTrue(as.read_uncommitted(u, tn) == null);
as.write_committed(u, tn, buff);
as.read_committed(u, tn);
assertTrue(!as.remove_uncommitted(u, tn));
as.remove_committed(u, tn);
assertTrue(!as.hide_state(u, tn));
assertTrue(!as.reveal_state(u, tn));
}
}
use of com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean in project narayana by jbosstm.
the class ObjectStoreTest method testShadowingStore.
@Test
public void testShadowingStore() throws Exception {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot("tmp");
ShadowingStore as = new ShadowingStore(objectStoreEnvironmentBean);
final OutputObjectState buff = new OutputObjectState();
final String tn = "/StateManager/junit";
for (int i = 0; i < 100; i++) {
Uid u = new Uid();
as.write_uncommitted(u, tn, buff);
as.commit_state(u, tn);
assertTrue(as.currentState(u, tn) != StateStatus.OS_UNCOMMITTED);
InputObjectState ios = new InputObjectState();
as.allObjUids("", ios);
assertTrue(as.read_uncommitted(u, tn) == null);
as.write_committed(u, tn, buff);
as.read_committed(u, tn);
assertTrue(!as.remove_uncommitted(u, tn));
as.remove_committed(u, tn);
assertTrue(!as.hide_state(u, tn));
assertTrue(!as.reveal_state(u, tn));
}
}
use of com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean in project narayana by jbosstm.
the class ObjectStoreTest method testTypedTwoPhaseVolatileStore.
@Test
public void testTypedTwoPhaseVolatileStore() throws Exception {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot("tmp");
objectStoreEnvironmentBean.setVolatileStoreSupportAllObjUids(true);
typedVolatileStoreCommon(new TwoPhaseVolatileStore(objectStoreEnvironmentBean));
}
use of com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean in project narayana by jbosstm.
the class ObjectStoreTest method testTypedVolatileStore.
@Test
public void testTypedVolatileStore() throws Exception {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot("tmp");
objectStoreEnvironmentBean.setVolatileStoreSupportAllObjUids(true);
typedVolatileStoreCommon(new VolatileStore(objectStoreEnvironmentBean));
}
use of com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean in project narayana by jbosstm.
the class ObjectStoreTest method testNullActionStore.
@Test
public void testNullActionStore() throws Exception {
ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
objectStoreEnvironmentBean.setLocalOSRoot("tmp");
NullActionStore as = new NullActionStore(objectStoreEnvironmentBean);
final OutputObjectState buff = new OutputObjectState();
final String tn = "/StateManager/junit";
for (int i = 0; i < 100; i++) {
Uid u = new Uid();
as.write_uncommitted(u, tn, buff);
as.commit_state(u, tn);
assertTrue(as.currentState(u, tn) != StateStatus.OS_UNCOMMITTED);
InputObjectState ios = new InputObjectState();
as.allObjUids("", ios);
assertTrue(as.read_uncommitted(u, tn) == null);
as.write_committed(u, tn, buff);
as.read_committed(u, tn);
assertTrue(!as.remove_uncommitted(u, tn));
as.remove_committed(u, tn);
assertTrue(!as.hide_state(u, tn));
assertTrue(!as.reveal_state(u, tn));
}
}
Aggregations