public void testValidIcon() { Icon icon1 = iconRepository.getIcon("MW"); assertNotNull(icon1); // test cache Icon icon2 = iconRepository.getIcon("MW"); assertTrue(icon1 == icon2); }
public void testKey() { Icon icon = null; boolean exCaught = false; try { icon = iconRepository.getIcon("DOUBLE_BOGUS_MW"); } catch (MissingIconException ex) { if (ex.getKey().equals("DOUBLE_BOGUS_MW")) { exCaught = true; } } assertTrue("bogus icon: " + icon, exCaught); }