}
public void testCheckVersionId() throws IOException, StorageException{
this.modifier.forceWrite();
ReferenceCounter<StorageQuery> sQuery = this.controller.getStorageQuery();
ServerBaseEntry entry = new ServerBaseEntry(new Entry());
entry.setId("test");
entry.setServiceConfig(this.configurator);
entry.setUpdated(new DateTime(System.currentTimeMillis(),0));
entry.setFeedId(feedId);
entry.setVersion(5);
StorageEntryWrapper wrapper = new StorageEntryWrapper(entry,StorageOperation.INSERT);
this.modifier.insertEntry(wrapper);
//test in buffer
assertTrue(sQuery.get().checkEntryVersion(entry.getId(),entry.getFeedId(),entry.getVersion()));
assertFalse(sQuery.get().checkEntryVersion(entry.getId(),entry.getFeedId(),10000));
assertFalse(sQuery.get().checkEntryVersion(entry.getId(),"someOtherFeed",entry.getVersion()));
assertFalse(sQuery.get().checkEntryVersion("foobar",entry.getFeedId(),entry.getVersion()));
this.modifier.forceWrite();
//test in buffer after written
assertTrue(sQuery.get().checkEntryVersion(entry.getId(),entry.getFeedId(),entry.getVersion()));
assertFalse(sQuery.get().checkEntryVersion(entry.getId(),entry.getFeedId(),10000));
assertFalse(sQuery.get().checkEntryVersion(entry.getId(),"someOtherFeed",entry.getVersion()));
assertFalse(sQuery.get().checkEntryVersion("foobar",entry.getFeedId(),entry.getVersion()));
sQuery.decrementRef();
sQuery = this.controller.getStorageQuery();
//test in index
assertTrue(sQuery.get().checkEntryVersion(entry.getId(),entry.getFeedId(),entry.getVersion()));
assertFalse(sQuery.get().checkEntryVersion(entry.getId(),entry.getFeedId(),10000));
assertFalse(sQuery.get().checkEntryVersion("foobar",entry.getFeedId(),entry.getVersion()));
sQuery.decrementRef();