Search in sources :

Example 1 with ShadowNoFileLockStore

use of com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore in project narayana by jbosstm.

the class ObjectStoreTest method testShadowNoFileLockStore.

@Test
public void testShadowNoFileLockStore() throws Exception {
    ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
    objectStoreEnvironmentBean.setLocalOSRoot("tmp");
    ShadowNoFileLockStore as = new ShadowNoFileLockStore(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));
    }
}
Also used : ObjectStoreEnvironmentBean(com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean) Uid(com.arjuna.ats.arjuna.common.Uid) InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) ShadowNoFileLockStore(com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore) OutputObjectState(com.arjuna.ats.arjuna.state.OutputObjectState) Test(org.junit.Test)

Aggregations

ObjectStoreEnvironmentBean (com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean)1 Uid (com.arjuna.ats.arjuna.common.Uid)1 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)1 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)1 ShadowNoFileLockStore (com.arjuna.ats.internal.arjuna.objectstore.ShadowNoFileLockStore)1 Test (org.junit.Test)1