public void onlySizeBoundedObjectStore() throws Exception
{
final int maxEntries = 5;
final int entryTTL = UNBOUNDED;
final ListableObjectStore os = objectStoreFactory.createObjectStore("myOs", maxEntries, entryTTL, 1000);
for (int i = 0; i < maxEntries + 1; i++)
{
os.store(i, i);
}
PollingProber prober = new PollingProber(5000000, 1000);
prober.check(new JUnitProbe()
{
@Override
public boolean test() throws Exception
{
assertThat(os.allKeys().size(), is(maxEntries));
for (int i = 1; i < maxEntries +1; i++)
{
assertThat(os.contains(i), is(true));
}
return true;
}