Changeset 17609 in josm for trunk/test
- Timestamp:
- 2021-03-20T23:07:02+01:00 (4 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckGroupTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 … … 13 11 import org.junit.jupiter.api.Test; 14 12 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm. data.osm.OsmPrimitive;13 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 16 14 17 15 /** … … 36 34 JPanel p = new JPanel(); 37 35 assertEquals(0, p.getComponentCount()); 38 assertFalse(cg.addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));36 assertFalse(cg.addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 39 37 assertTrue(p.getComponentCount() > 0); 40 38 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/CheckTest.java
r17275 r17609 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import java.util.Collections;8 9 7 import javax.swing.JPanel; 10 8 11 9 import org.junit.jupiter.api.extension.RegisterExtension; 12 10 import org.junit.jupiter.api.Test; 13 import org.openstreetmap.josm. data.osm.OsmPrimitive;11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 import org.openstreetmap.josm.testutils.JOSMTestRules; 15 13 … … 35 33 JPanel p = new JPanel(); 36 34 assertEquals(0, p.getComponentCount()); 37 assertTrue(new Check().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));35 assertTrue(new Check().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 38 36 assertTrue(p.getComponentCount() > 0); 39 37 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ComboTest.java
r17275 r17609 6 6 7 7 import java.awt.Color; 8 import java.util.Arrays;9 import java.util.Collections;10 8 11 9 import javax.swing.JPanel; … … 15 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 14 import org.openstreetmap.josm.data.osm.OsmUtils; 15 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 17 16 import org.openstreetmap.josm.testutils.JOSMTestRules; 18 17 … … 38 37 JPanel p = new JPanel(); 39 38 assertEquals(0, p.getComponentCount()); 40 assertTrue(new Combo().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));39 assertTrue(new Combo().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 41 40 assertTrue(p.getComponentCount() > 0); 42 41 } … … 55 54 OsmPrimitive waySI = OsmUtils.createPrimitive("way addr:country=SI"); 56 55 57 combo.addToPanel(new JPanel(), Collections.singleton(way), false);56 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(false, way)); 58 57 assertEquals("", combo.getSelectedValue()); 59 58 60 59 combo.default_ = "SI"; 61 combo.addToPanel(new JPanel(), Collections.singleton(way), false);60 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(false, way)); 62 61 assertEquals("SI", combo.getSelectedValue()); 63 combo.addToPanel(new JPanel(), Collections.singleton(wayAT), false);62 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(false, wayAT)); 64 63 assertEquals("AT", combo.getSelectedValue()); 65 64 combo.default_ = null; … … 67 66 KeyedItem.LAST_VALUES.clear(); 68 67 KeyedItem.LAST_VALUES.put("addr:country", "AT"); 69 combo.addToPanel(new JPanel(), Collections.singleton(way), false);68 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(false, way)); 70 69 assertEquals("AT", combo.getSelectedValue()); 71 combo.addToPanel(new JPanel(), Collections.singleton(wayAT), true);70 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(true, wayAT)); 72 71 assertEquals("AT", combo.getSelectedValue()); 73 combo.addToPanel(new JPanel(), Collections.singleton(way), true);72 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(true)); 74 73 assertEquals("", combo.getSelectedValue()); 75 74 combo.use_last_as_default = 2; // "force" 76 combo.addToPanel(new JPanel(), Collections.singleton(way), true);75 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(true)); 77 76 assertEquals("AT", combo.getSelectedValue()); 78 77 KeyedItem.LAST_VALUES.clear(); 79 78 80 combo.addToPanel(new JPanel(), Arrays.asList(wayAT, waySI), true);79 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(true, wayAT, waySI)); 81 80 assertEquals(Combo.DIFFERENT, combo.getSelectedValue()); 82 81 } … … 89 88 combo.values_context = "color"; 90 89 combo.delimiter = ';'; 91 combo.addToPanel(new JPanel(), Collections.<OsmPrimitive>emptyList(), false);90 combo.addToPanel(new JPanel(), TaggingPresetItemGuiSupport.create(false)); 92 91 assertEquals(5, combo.combobox.getItemCount()); 93 92 combo.presetListEntries.stream().filter(e -> "red".equals(e.value)).findFirst().ifPresent(combo.combobox::setSelectedItem); -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/ItemSeparatorTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 … … 13 11 import org.junit.jupiter.api.Test; 14 12 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm. data.osm.OsmPrimitive;13 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 16 14 17 15 /** … … 35 33 JPanel p = new JPanel(); 36 34 assertEquals(0, p.getComponentCount()); 37 assertFalse(new ItemSeparator().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));35 assertFalse(new ItemSeparator().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 38 36 assertTrue(p.getComponentCount() > 0); 39 37 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/KeyTest.java
r17275 r17609 5 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 6 7 import java.util.Collections;8 9 7 import javax.swing.JPanel; 10 8 … … 12 10 import org.junit.jupiter.api.Test; 13 11 import org.openstreetmap.josm.JOSMFixture; 14 import org.openstreetmap.josm. data.osm.OsmPrimitive;12 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 15 13 16 14 /** … … 34 32 JPanel p = new JPanel(); 35 33 assertEquals(0, p.getComponentCount()); 36 assertFalse(new Key().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));34 assertFalse(new Key().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 37 35 assertEquals(0, p.getComponentCount()); 38 36 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LabelTest.java
r17275 r17609 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import java.util.Collections;8 9 7 import javax.swing.JPanel; 10 8 … … 12 10 import org.junit.jupiter.api.Test; 13 11 import org.openstreetmap.josm.JOSMFixture; 14 import org.openstreetmap.josm. data.osm.OsmPrimitive;12 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 15 13 16 14 /** … … 34 32 JPanel p = new JPanel(); 35 33 assertEquals(0, p.getComponentCount()); 36 assertTrue(new Label().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));34 assertTrue(new Label().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 37 35 assertTrue(p.getComponentCount() > 0); 38 36 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/LinkTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 … … 13 11 import org.junit.jupiter.api.Test; 14 12 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm. data.osm.OsmPrimitive;13 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 16 14 import org.openstreetmap.josm.spi.preferences.Config; 17 15 … … 37 35 JPanel p = new JPanel(); 38 36 assertEquals(0, p.getComponentCount()); 39 assertFalse(l.addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));37 assertFalse(l.addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 40 38 assertEquals(0, p.getComponentCount()); 41 39 42 40 l.href = Config.getUrls().getJOSMWebsite(); 43 assertFalse(l.addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));41 assertFalse(l.addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 44 42 assertTrue(p.getComponentCount() > 0); 45 43 46 44 l.locale_href = Config.getUrls().getJOSMWebsite(); 47 assertFalse(l.addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));45 assertFalse(l.addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 48 46 assertTrue(p.getComponentCount() > 0); 49 47 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelectTest.java
r17275 r17609 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import java.util.Collections;8 9 7 import javax.swing.JPanel; 10 8 … … 12 10 import org.junit.jupiter.api.Test; 13 11 import org.openstreetmap.josm.JOSMFixture; 14 import org.openstreetmap.josm. data.osm.OsmPrimitive;12 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 15 13 16 14 /** … … 34 32 JPanel p = new JPanel(); 35 33 assertEquals(0, p.getComponentCount()); 36 assertTrue(new MultiSelect().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));34 assertTrue(new MultiSelect().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 37 35 assertTrue(p.getComponentCount() > 0); 38 36 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/OptionalTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 … … 13 11 import org.junit.jupiter.api.Test; 14 12 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm. data.osm.OsmPrimitive;13 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 16 14 17 15 /** … … 35 33 JPanel p = new JPanel(); 36 34 assertEquals(0, p.getComponentCount()); 37 assertFalse(new Optional().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));35 assertFalse(new Optional().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 38 36 assertTrue(p.getComponentCount() > 0); 39 37 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/PresetLinkTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 12 10 import org.junit.jupiter.api.extension.RegisterExtension; 13 11 import org.junit.jupiter.api.Test; 14 import org.openstreetmap.josm. data.osm.OsmPrimitive;12 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 15 13 import org.openstreetmap.josm.testutils.JOSMTestRules; 16 14 … … 38 36 JPanel p = new JPanel(); 39 37 assertEquals(0, p.getComponentCount()); 40 assertFalse(l.addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));38 assertFalse(l.addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 41 39 assertTrue(p.getComponentCount() > 0); 42 40 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/RolesTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 … … 13 11 import org.junit.jupiter.api.Test; 14 12 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm. data.osm.OsmPrimitive;13 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 16 14 17 15 /** … … 35 33 JPanel p = new JPanel(); 36 34 assertEquals(0, p.getComponentCount()); 37 assertFalse(new Roles().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));35 assertFalse(new Roles().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 38 36 assertTrue(p.getComponentCount() > 0); 39 37 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/SpaceTest.java
r17275 r17609 6 6 import static org.junit.jupiter.api.Assertions.assertTrue; 7 7 8 import java.util.Collections;9 10 8 import javax.swing.JPanel; 11 9 … … 13 11 import org.junit.jupiter.api.Test; 14 12 import org.openstreetmap.josm.JOSMFixture; 15 import org.openstreetmap.josm. data.osm.OsmPrimitive;13 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 16 14 17 15 /** … … 35 33 JPanel p = new JPanel(); 36 34 assertEquals(0, p.getComponentCount()); 37 assertFalse(new Space().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));35 assertFalse(new Space().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 38 36 assertTrue(p.getComponentCount() > 0); 39 37 } -
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/items/TextTest.java
r17275 r17609 5 5 import static org.junit.jupiter.api.Assertions.assertTrue; 6 6 7 import java.util.Collections;8 9 7 import javax.swing.JPanel; 10 8 11 9 import org.junit.jupiter.api.extension.RegisterExtension; 12 10 import org.junit.jupiter.api.Test; 13 import org.openstreetmap.josm. data.osm.OsmPrimitive;11 import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItemGuiSupport; 14 12 import org.openstreetmap.josm.testutils.JOSMTestRules; 15 13 … … 35 33 JPanel p = new JPanel(); 36 34 assertEquals(0, p.getComponentCount()); 37 assertTrue(new Text().addToPanel(p, Collections.<OsmPrimitive>emptyList(), false));35 assertTrue(new Text().addToPanel(p, TaggingPresetItemGuiSupport.create(false))); 38 36 assertTrue(p.getComponentCount() > 0); 39 37 }
Note:
See TracChangeset
for help on using the changeset viewer.