- Timestamp:
- 2016-04-09T19:12:05+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialogTest.java
r9762 r10127 3 3 4 4 import static org.junit.Assert.assertEquals; 5 6 import java.util.ArrayList; 7 import java.util.Collections; 8 import java.util.List; 5 9 6 10 import org.junit.BeforeClass; … … 10 14 import org.openstreetmap.josm.data.osm.DataSet; 11 15 import org.openstreetmap.josm.data.osm.Node; 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.data.osm.OsmPrimitiveComparator; 12 18 import org.openstreetmap.josm.data.osm.Way; 13 19 … … 23 29 public static void setUpBeforeClass() { 24 30 JOSMFixture.createUnitTestFixture().init(); 31 } 32 33 private static String createSearchSetting(DataSet ds, boolean sameType) { 34 List<OsmPrimitive> sel = new ArrayList<>(ds.allPrimitives()); 35 Collections.sort(sel, new OsmPrimitiveComparator(true, false)); 36 return PropertiesDialog.createSearchSetting("foo", sel, sameType).text; 25 37 } 26 38 … … 39 51 ds.addPrimitive(n); 40 52 } 41 assertEquals("(\"foo\"=\"bar\")", 42 PropertiesDialog.createSearchSetting("foo", ds.allPrimitives(), false).text); 53 assertEquals("(\"foo\"=\"bar\")", createSearchSetting(ds, false)); 43 54 44 55 Node n = new Node(LatLon.ZERO); … … 46 57 ds.addPrimitive(n); 47 58 48 assertEquals("(\"foo\"=\"bar\") OR (\"foo\"=\"baz\")", 49 PropertiesDialog.createSearchSetting("foo", ds.allPrimitives(), false).text); 59 assertEquals("(\"foo\"=\"baz\") OR (\"foo\"=\"bar\")", createSearchSetting(ds, false)); 50 60 51 61 ds.removePrimitive(n); … … 55 65 ds.addPrimitive(w); 56 66 57 assertEquals("(type:node \"foo\"=\"bar\") OR (type:way \"foo\"=\"bar\")", 58 PropertiesDialog.createSearchSetting("foo", ds.allPrimitives(), true).text); 67 assertEquals("(type:way \"foo\"=\"bar\") OR (type:node \"foo\"=\"bar\")", createSearchSetting(ds, true)); 59 68 } 60 69 }
Note:
See TracChangeset
for help on using the changeset viewer.