Changeset 13793 in josm
- Timestamp:
- 2018-05-20T21:19:27+02:00 (7 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/defaultpresets.xml
r13789 r13793 4126 4126 <combo key="reservation" text="Reservation" values="yes,no,required,recommended,members_only" /> 4127 4127 <text key="ele" text="Elevation" /> 4128 <text key="description" text="Closer Description" />4128 <text key="description" text="Closer description" /> 4129 4129 <space /> 4130 4130 <reference ref="link_contact_address_payment" /> … … 4440 4440 <combo key="map_type" text="Detail Grade" values="topo,street,scheme,toposcope" /> 4441 4441 <combo key="map_size" text="Shown Area" values="site,city,region" /> 4442 <text key="description" text="Closer Description" />4442 <text key="description" text="Closer description" /> 4443 4443 <optional text="Routes shown for:"> 4444 4444 <check key="hiking" text="Hiking" /> … … 4464 4464 <text key="name" text="Name" /> 4465 4465 <combo key="board_type" text="Board Content" values="notice,history,nature,wildlife,plants,geology" /> 4466 <text key="description" text="Closer Description" />4466 <text key="description" text="Closer description" /> 4467 4467 </item> <!-- Information Board --> 4468 4468 <item name="Guidepost" icon="presets/misc/information/guidepost.svg" type="node" preset_name_label="true"> … … 4542 4542 <key key="tourism" value="information" /> 4543 4543 <text key="name" text="Name" /> 4544 <text key="description" text="Closer Description" />4544 <text key="description" text="Closer description" /> 4545 4545 </item> <!-- Other Information Point --> 4546 4546 </group> <!-- Tourism --> -
trunk/scripts/I18nSimilarStrings.java
r13761 r13793 3 3 import java.util.List; 4 4 5 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.data.Preferences; 7 import org.openstreetmap.josm.data.UndoRedoHandler; 8 import org.openstreetmap.josm.data.preferences.JosmBaseDirectories; 5 9 import org.openstreetmap.josm.data.validation.tests.SimilarNamedWays; 10 import org.openstreetmap.josm.gui.MainApplication; 11 import org.openstreetmap.josm.gui.MainApplicationTest; 12 import org.openstreetmap.josm.plugins.PluginHandlerTestIT; 13 import org.openstreetmap.josm.spi.preferences.Config; 6 14 import org.openstreetmap.josm.tools.I18n; 7 15 … … 19 27 public static void main(String[] args) { 20 28 I18n.init(); 29 Main.determinePlatformHook(); 30 Config.setBaseDirectoriesProvider(JosmBaseDirectories.getInstance()); 31 Preferences pref = new Preferences(); 32 Config.setPreferencesInstance(pref); 33 pref.init(false); 34 MainApplication.undoRedo = new UndoRedoHandler(); 35 MainApplicationTest.initContentPane(); 36 MainApplicationTest.initToolbar(); 37 MainApplicationTest.initMainMenu(); 38 PluginHandlerTestIT.loadAllPlugins(); 21 39 List<String> strings = new ArrayList<>(); 22 40 strings.addAll(I18n.getSingularTranslations().keySet()); 23 41 strings.addAll(I18n.getPluralTranslations().keySet()); 24 System.out.println("Loaded " + strings.size() + " corestrings");42 System.out.println("Loaded " + strings.size() + " strings"); 25 43 strings.removeIf(s -> s.length() <= 5); 26 System.out.println("Kept " + strings.size() + " corestrings longer than 5 characters");44 System.out.println("Kept " + strings.size() + " strings longer than 5 characters"); 27 45 Collections.sort(strings); 28 46 for (int i = 0; i < strings.size(); i++) { -
trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
r12849 r13793 50 50 @Test 51 51 public void testValidityOfAvailablePlugins() { 52 loadAllPlugins(); 53 54 Map<String, Throwable> loadingExceptions = PluginHandler.pluginLoadingExceptions.entrySet().stream() 55 .collect(Collectors.toMap(e -> e.getKey(), e -> ExceptionUtils.getRootCause(e.getValue()))); 56 57 // Add/remove layers twice to test basic plugin good behaviour 58 Map<String, Throwable> layerExceptions = new HashMap<>(); 59 List<PluginInformation> loadedPlugins = PluginHandler.getPlugins(); 60 for (int i = 0; i < 2; i++) { 61 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Layer "+i, null); 62 testPlugin(MainApplication.getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins); 63 testPlugin(MainApplication.getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins); 64 } 65 for (int i = 0; i < 2; i++) { 66 GpxLayer layer = new GpxLayer(new GpxData()); 67 testPlugin(MainApplication.getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins); 68 testPlugin(MainApplication.getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins); 69 } 70 71 MapUtils.debugPrint(System.out, null, loadingExceptions); 72 MapUtils.debugPrint(System.out, null, layerExceptions); 73 String msg = Arrays.toString(loadingExceptions.entrySet().toArray()) + '\n' + 74 Arrays.toString(layerExceptions.entrySet().toArray()); 75 assertTrue(msg, loadingExceptions.isEmpty() && layerExceptions.isEmpty()); 76 } 77 78 /** 79 * Downloads and loads all JOSM plugins. 80 */ 81 public static void loadAllPlugins() { 52 82 // Download complete list of plugins 53 83 ReadRemotePluginInformationTask pluginInfoDownloadTask = new ReadRemotePluginInformationTask( … … 81 111 // Load late plugins 82 112 PluginHandler.loadLatePlugins(null, plugins, null); 83 84 Map<String, Throwable> loadingExceptions = PluginHandler.pluginLoadingExceptions.entrySet().stream()85 .collect(Collectors.toMap(e -> e.getKey(), e -> ExceptionUtils.getRootCause(e.getValue())));86 87 // Add/remove layers twice to test basic plugin good behaviour88 Map<String, Throwable> layerExceptions = new HashMap<>();89 List<PluginInformation> loadedPlugins = PluginHandler.getPlugins();90 for (int i = 0; i < 2; i++) {91 OsmDataLayer layer = new OsmDataLayer(new DataSet(), "Layer "+i, null);92 testPlugin(MainApplication.getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins);93 testPlugin(MainApplication.getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins);94 }95 for (int i = 0; i < 2; i++) {96 GpxLayer layer = new GpxLayer(new GpxData());97 testPlugin(MainApplication.getLayerManager()::addLayer, layer, layerExceptions, loadedPlugins);98 testPlugin(MainApplication.getLayerManager()::removeLayer, layer, layerExceptions, loadedPlugins);99 }100 101 MapUtils.debugPrint(System.out, null, loadingExceptions);102 MapUtils.debugPrint(System.out, null, layerExceptions);103 String msg = Arrays.toString(loadingExceptions.entrySet().toArray()) + '\n' +104 Arrays.toString(layerExceptions.entrySet().toArray());105 assertTrue(msg, loadingExceptions.isEmpty() && layerExceptions.isEmpty());106 113 } 107 114
Note:
See TracChangeset
for help on using the changeset viewer.