cacheBox.addItem(testInput);
cacheBox.setSelectedItem(testInput);
cacheBox.updateCache();
- boolean done[]=new boolean[] { false };
+ boolean done[] = new boolean[] { false };
// this event gets processed after updateCache's update event on the swing
// thread
SwingUtilities.invokeLater(() -> {
- done[0]=true;
+ done[0] = true;
});
- long t=0;
- while (!done[0] && t<200)
+ long t = 0;
+ while (!done[0] && t < 200)
{
- try {
+ try
+ {
Thread.sleep(7);
t++;
- } catch (InterruptedException e)
- {
- e.printStackTrace();
- }
+ } catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
}
if (!done[0])
{
Assert.fail("Giving up after 1.4s waiting for cache to be updated.");
}
-
+
LinkedHashSet<String> foundCache = appCache
.getAllCachedItemsFor(TEST_CACHE_KEY);
Assert.assertTrue(foundCache.contains(testInput));