float expected = 55.0f;// the 100 previous + the 10 added now / the 2 minutes that elapsed
assertEquals(expected, frequencyOfUsePerMinute, 1e-6f);
}
public void testGetGloballyUsedQuota() throws InterruptedException {
Quota usedQuota = store.getGloballyUsedQuota();
assertNotNull(usedQuota);
assertEquals(0, usedQuota.getBytes().intValue());
String layerName = tilePageCalculator.getLayerNames().iterator().next();
TileSet tileSet = tilePageCalculator.getTileSetsFor(layerName).iterator().next();
final String tileSetId = tileSet.getId();
Quota quotaDiff = new Quota(BigInteger.valueOf(1000));
Collection<PageStatsPayload> tileCountDiffs = Collections.emptySet();
store.addToQuotaAndTileCounts(tileSet, quotaDiff, tileCountDiffs);
usedQuota = store.getGloballyUsedQuota();
assertNotNull(usedQuota);
assertEquals(1000, usedQuota.getBytes().intValue());
quotaDiff = new Quota(BigInteger.valueOf(-500));
store.addToQuotaAndTileCounts(tileSet, quotaDiff, tileCountDiffs);
usedQuota = store.getGloballyUsedQuota();
assertNotNull(usedQuota);
assertEquals(500, usedQuota.getBytes().intValue());