Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
todd534 committed Jan 3, 2017
1 parent 7a771d5 commit 078695e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/java/com/urbanairship/datacube/IdServiceTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static void testExhaustion(IdService idService, int numFieldBytes, int di
}
}
}

@Test
public void testCacheMissingOff() throws IOException, InterruptedException {
final CountingIdService wrappedIdService = new CountingIdService();
Expand All @@ -79,7 +79,9 @@ public void testCacheMissingOff() throws IOException, InterruptedException {
lol.getId(-1, CountingIdService.unknown, 0);
lol.getId(-1, CountingIdService.known, 0);
lol.getId(-1, CountingIdService.known, 0);
// should not have been cached, so accessed backing store twice
Assert.assertEquals(2, wrappedIdService.unKnownCount.get());
// should have been cached, so accessed backing store once
Assert.assertEquals(1, wrappedIdService.knownCount.get());
}

Expand All @@ -91,7 +93,9 @@ public void testCacheMissingOn() throws IOException, InterruptedException {
lol.getId(-1, CountingIdService.unknown, 0);
lol.getId(-1, CountingIdService.known, 0);
lol.getId(-1, CountingIdService.known, 0);
// should have been cached, so accessed backing store once
Assert.assertEquals(1, wrappedIdService.unKnownCount.get());
// should have been cached, so accessed backing store once
Assert.assertEquals(1, wrappedIdService.knownCount.get());
}

Expand Down

0 comments on commit 078695e

Please sign in to comment.