X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fio%2Fcache%2FJvCacheableInputBoxTest.java;h=fb0cf07572fdd27a0d8a27847cc33dfcc0f477d0;hb=1bbf9cd2904a084b5f4df2db064a477480e5c688;hp=4d25cb51f656d17da1fdbe9d41f8f69edd851401;hpb=257a5c22aad2205509236e7a1f4a2739db656460;p=jalview.git diff --git a/test/jalview/io/cache/JvCacheableInputBoxTest.java b/test/jalview/io/cache/JvCacheableInputBoxTest.java index 4d25cb5..fb0cf07 100644 --- a/test/jalview/io/cache/JvCacheableInputBoxTest.java +++ b/test/jalview/io/cache/JvCacheableInputBoxTest.java @@ -13,7 +13,7 @@ public class JvCacheableInputBoxTest private static final String TEST_CACHE_KEY = "CACHE.UNIT_TEST"; - private JvCacheableInputBox cacheBox = new JvCacheableInputBox( + private JvCacheableInputBox cacheBox = new JvCacheableInputBox<>( TEST_CACHE_KEY); @BeforeClass(alwaysRun = true) @@ -53,8 +53,11 @@ public class JvCacheableInputBoxTest cacheBox.addItem(testInput); cacheBox.setSelectedItem(testInput); cacheBox.updateCache(); + synchronized (this) + { try { + wait(100); // This delay is to let // cacheBox.updateCache() finish updating the cache Thread.sleep(200); @@ -62,6 +65,7 @@ public class JvCacheableInputBoxTest { e.printStackTrace(); } + } LinkedHashSet foundCache = appCache .getAllCachedItemsFor(TEST_CACHE_KEY); Assert.assertTrue(foundCache.contains(testInput));