@Test public void LRUUpdateInfoTest() { MAIDCacheDiskStateManager sm2 = new MAIDCacheDiskStateManager( Parameter.MOUNT_POINT_PATHS, Parameter.CACHE_DISK_PATHS, Parameter.ACCESS_THRESHOLD, Parameter.ACCESS_INTERVAL, Parameter.RMI_URL, Parameter.IS_CACHEDISK, Parameter.NUMBER_OF_CACHE_DISKS, Parameter.NUMBER_OF_DATA_DISKS); OLDMAIDCacheDiskManager dm2 = new OLDMAIDCacheDiskManager( CACHE_DISK_PATHS, Parameter.DATA_DISK_SAVE_FILE_PATH, Parameter.MOUNT_POINT_PATHS, Parameter.SPIN_DOWN_THRESHOLD, CAPACITY_OF_CACHEDISK, sm2); Value v = new Value("valuevalue".getBytes()); int key4 = 4; assertThat(dm2.put(key, v), is(true)); assertThat(dm2.put(key2, v), is(true)); assertThat(dm2.put(key3, v), is(true)); assertThat(dm2.get(key).getValue(), is(v.getValue())); assertThat(dm2.put(key4, v), is(true)); assertThat(dm2.get(key).getValue(), is(v.getValue())); assertThat(dm2.get(key2), is(Value.NULL)); }
@Test public void mainTest2() { // FIXME Parameter.CAPACITY_OF_CACHEDISKの大きさによって失敗する場合がある assertThat(dm.put(key, value), is(true)); assertThat(dm.put(key2, value2), is(true)); assertThat(dm.get(key).getValue(), is(value.getValue())); assertThat(dm.get(key2).getValue(), is(value2.getValue())); assertThat(dm.put(key, value2), is(true)); assertThat(dm.get(key).getValue(), is(value2.getValue())); assertThat(dm.put(key2, value), is(true)); assertThat(dm.get(key2).getValue(), is(value.getValue())); assertThat(dm.put(key3, value3), is(true)); assertThat(dm.get(key3).getValue(), is(value3.getValue())); assertThat(dm.delete(key), is(true)); assertThat(dm.delete(key2), is(true)); assertThat(dm.delete(key3), is(true)); assertThat(dm.get(key), is(Value.NULL)); assertThat(dm.put(key, value), is(true)); assertThat(dm.get(key).getValue(), is(value.getValue())); assertThat(dm.delete(key), is(true)); }
@Test public void mainTest() { assertThat(dm.put(key, value), is(true)); assertThat(dm.get(key).getValue(), is(value.getValue())); assertThat(dm.delete(key), is(true)); }