コード例 #1
0
 public void testValidIcon() {
   Icon icon1 = iconRepository.getIcon("MW");
   assertNotNull(icon1);
   // test cache
   Icon icon2 = iconRepository.getIcon("MW");
   assertTrue(icon1 == icon2);
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 public void testHasIcon() {
   assertFalse(iconRepository.hasIcon("BOGUS_MW"));
   assertTrue(iconRepository.hasIcon("MW"));
 }