Changeset 15015 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-04-22T16:43:22+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/io/UploadDialogTest.java
r15013 r15015 9 9 import java.awt.GraphicsEnvironment; 10 10 import java.util.Arrays; 11 import java.util.Collections; 11 12 import java.util.List; 12 13 import java.util.Map; … … 261 262 262 263 private static void doTestValidateUploadTag(String prefix) { 264 List<String> def = Collections.emptyList(); 263 265 Config.getPref().putList(prefix + ".mandatory-terms", null); 264 266 Config.getPref().putList(prefix + ".forbidden-terms", null); 265 assertNull(UploadAction.validateUploadTag("foo", prefix ));267 assertNull(UploadAction.validateUploadTag("foo", prefix, def, def)); 266 268 267 269 Config.getPref().putList(prefix + ".mandatory-terms", Arrays.asList("foo")); 268 assertNull(UploadAction.validateUploadTag("foo", prefix ));270 assertNull(UploadAction.validateUploadTag("foo", prefix, def, def)); 269 271 assertEquals("The following required terms are missing: [foo]", 270 UploadAction.validateUploadTag("bar", prefix ));272 UploadAction.validateUploadTag("bar", prefix, def, def)); 271 273 272 274 Config.getPref().putList(prefix + ".forbidden-terms", Arrays.asList("bar")); 273 assertNull(UploadAction.validateUploadTag("foo", prefix ));275 assertNull(UploadAction.validateUploadTag("foo", prefix, def, def)); 274 276 assertEquals("The following forbidden terms have been found: [bar]", 275 UploadAction.validateUploadTag("foobar", prefix)); 277 UploadAction.validateUploadTag("foobar", prefix, def, def)); 278 assertEquals("The following forbidden terms have been found: [bar]", 279 UploadAction.validateUploadTag("FOOBAR", prefix, def, def)); 276 280 } 277 281
Note:
See TracChangeset
for help on using the changeset viewer.