Changeset 255 in josm for test/org/openstreetmap/josm/gui
- Timestamp:
- 2007-06-13T22:30:51+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/org/openstreetmap/josm/gui/annotation/AnnotationPresetTest.java
r193 r255 1 1 package org.openstreetmap.josm.gui.annotation; 2 2 3 import java.io.ByteArrayInputStream; 3 4 import java.io.InputStream; 4 5 import java.lang.reflect.Field; … … 6 7 7 8 import javax.swing.Action; 9 import javax.swing.Icon; 8 10 9 11 import junit.framework.TestCase; … … 14 16 import org.openstreetmap.josm.gui.annotation.AnnotationPreset.Label; 15 17 import org.openstreetmap.josm.gui.annotation.AnnotationPreset.Text; 18 import org.openstreetmap.josm.tools.ImageProvider; 16 19 17 20 public class AnnotationPresetTest extends TestCase { … … 55 58 assertEquals("highway", key.value); 56 59 } 60 61 public void testIconLoadsFromClasspath() throws Exception { 62 String xml = "<annotations><item icon='logo'></item></annotations>"; 63 List<AnnotationPreset> all = AnnotationPreset.readAll(new ByteArrayInputStream(xml.getBytes())); 64 65 assertEquals(1, all.size()); 66 67 Icon icon = (Icon)all.get(0).getValue(Action.SMALL_ICON); 68 assertNotNull(icon); 69 assertEquals("Icon loaded and of correct size", 70 24, Math.max(icon.getIconHeight(), icon.getIconWidth())); 71 } 57 72 }
Note:
See TracChangeset
for help on using the changeset viewer.