X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=test%2Fjalview%2Fio%2Fcache%2FJvCacheableInputBoxTest.java;fp=test%2Fjalview%2Fio%2Fcache%2FJvCacheableInputBoxTest.java;h=a4ade0aa2913834c383268a7cfce0e14d4c66f3b;hp=ce340442549cfe68ecdc7c3baf6566a38ee0adff;hb=eb3e681d6e82ccdd5d312d1981dfb306e7f479f0;hpb=cb31e23d9138e481479623374aed7767bf8934d2 diff --git a/test/jalview/io/cache/JvCacheableInputBoxTest.java b/test/jalview/io/cache/JvCacheableInputBoxTest.java index ce34044..a4ade0a 100644 --- a/test/jalview/io/cache/JvCacheableInputBoxTest.java +++ b/test/jalview/io/cache/JvCacheableInputBoxTest.java @@ -84,28 +84,29 @@ public class JvCacheableInputBoxTest 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 foundCache = appCache .getAllCachedItemsFor(TEST_CACHE_KEY); Assert.assertTrue(foundCache.contains(testInput));