awaitBarrier(waitingComponentBarrier);
}
};
Content iconContent = new URLContent(iconURL);
Icon icon = iconManager.getIcon(iconContent, HEIGHT, waitingComponent);
assertEquals("Icon not equal to wait icon while loading", waitIconContent.getURL(), icon);
// Let iconManager load the iconContent
iconLoadingStartBarrier.await();
// Wait iconContent loading completion
waitingComponentBarrier.await();
if (goodIcon) {
assertEquals("Icon not equal to icon read from resource", iconURL, icon);
} else {
assertEquals("Wrong icon not equal to errorIcon", errorIconContent.getURL(), icon);
}
// Check icon is loaded with proxy
assertSame("Icon not loaded with IconProxy", icon.getClass(), iconProxyClass);
// Check that icon is stored in cache
Icon iconFromCache = iconManager.getIcon(iconContent, HEIGHT, waitingComponent);
assertSame("Test icon reloaded", icon, iconFromCache);
}