Index: /trunk/build.xml
===================================================================
--- /trunk/build.xml	(revision 9500)
+++ /trunk/build.xml	(revision 9501)
@@ -321,4 +321,5 @@
         <init-test-preferences testfamily="functional"/>
         <init-test-preferences testfamily="performance"/>
+        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
     </target>
     <target name="test-clean">
@@ -326,4 +327,5 @@
         <delete dir="${test.dir}/report"/>
         <delete file="${test.dir}/jacoco.exec" />
+        <delete file="${test.dir}/jacocoIT.exec" />
         <delete file="${test.dir}/config/unit-josm.home/preferences.xml" />
         <delete file="${test.dir}/config/functional-josm.home/preferences.xml" />
@@ -370,7 +372,8 @@
     <macrodef name="call-junit">
         <attribute name="testfamily"/>
+        <attribute name="testITsuffix" default=""/>
         <sequential>
-            <echo message="Running @{testfamily} tests with JUnit"/>
-            <jacoco:coverage destfile="${test.dir}/jacoco.exec">
+            <echo message="Running @{testfamily}@{testITsuffix} tests with JUnit"/>
+            <jacoco:coverage destfile="${test.dir}/jacoco@{testITsuffix}.exec">
                 <junit printsummary="yes" fork="true" forkmode="once">
                     <jvmarg value="-Dfile.encoding=UTF-8"/>
@@ -388,5 +391,5 @@
                     <formatter type="xml"/>
                     <batchtest fork="yes" todir="${test.dir}/report">
-                        <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test.class"/>
+                        <fileset dir="${test.dir}/build/@{testfamily}" includes="**/*Test@{testITsuffix}.class"/>
                     </batchtest>
                 </junit>
@@ -394,12 +397,17 @@
         </sequential>
     </macrodef>
-    <target name="test" depends="test-compile" 
+    <target name="test" depends="test-compile" unless="test.notRequired"
         description="Run unit, functional and performance tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
-        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="tools/jacocoant.jar" />
         <call-junit testfamily="unit"/>
         <call-junit testfamily="functional"/>
         <call-junit testfamily="performance"/>
     </target>
-    <target name="test-html" depends="test" description="Generate HTML test reports">
+    <target name="test-it" depends="test-compile" unless="test-it.notRequired"
+        description="Run integration tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
+        <call-junit testfamily="unit" testITsuffix="IT"/>
+        <call-junit testfamily="functional" testITsuffix="IT"/>
+        <call-junit testfamily="performance" testITsuffix="IT"/>
+    </target>
+    <target name="test-html" depends="test, test-it" description="Generate HTML test reports">
         <!-- May require additional ant dependencies like ant-trax package -->
         <junitreport todir="${test.dir}/report">
@@ -412,4 +420,5 @@
             <executiondata>
                 <file file="${test.dir}/jacoco.exec"/>
+                <file file="${test.dir}/jacocoIT.exec"/>
             </executiondata>
             <structure name="JOSM Test Coverage">
Index: unk/test/functional/org/openstreetmap/josm/data/osm/TaginfoIntegrationTest.java
===================================================================
--- /trunk/test/functional/org/openstreetmap/josm/data/osm/TaginfoIntegrationTest.java	(revision 9500)
+++ 	(revision )
@@ -1,85 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.data.osm;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.json.Json;
-import javax.json.JsonObject;
-import javax.json.JsonReader;
-import javax.json.JsonValue;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
-import org.openstreetmap.josm.data.validation.tests.TagChecker;
-import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
-import org.openstreetmap.josm.tools.HttpClient;
-import org.xml.sax.SAXException;
-
-/**
- * Various tests with Taginfo.
- */
-public class TaginfoIntegrationTest {
-
-    /**
-     * Setup test.
-     */
-    @BeforeClass
-    public static void setUp() {
-        JOSMFixture.createFunctionalTestFixture().init();
-    }
-
-    /**
-     * Checks that popular tags are known (i.e included in internal presets, or deprecated, or explicitely ignored)
-     * @throws SAXException if any XML parsing error occurs
-     * @throws IOException if any I/O error occurs
-     * @throws ParseException if any MapCSS parsing error occurs
-     */
-    @Test
-    public void checkPopularTags() throws SAXException, IOException, ParseException {
-        TaggingPresets.readFromPreferences();
-        new TagChecker().initialize();
-        MapCSSTagChecker mapCssTagChecker = new MapCSSTagChecker();
-        mapCssTagChecker.addMapCSS("resource://data/validator/deprecated.mapcss");
-
-        List<String> errors = new ArrayList<>();
-        try (InputStream in = HttpClient.create(new URL("https://taginfo.openstreetmap.org/api/4/tags/popular")).connect().getContent();
-             JsonReader reader = Json.createReader(in)) {
-            for (JsonValue item : reader.readObject().getJsonArray("data")) {
-                JsonObject obj = (JsonObject) item;
-                // Only consider tags with wiki pages
-                if (obj.getInt("in_wiki") == 1) {
-                    String key = obj.getString("key");
-                    String value = obj.getString("value");
-                    System.out.print("Checking "+key+"="+value+" ... ");
-                    boolean ok = true;
-                    // Check if tag is in internal presets
-                    if (!TagChecker.isTagInPresets(key, value)) {
-                        // If not, check if we have either a deprecated mapcss test for it
-                        Node n = new Node();
-                        n.put(key, value);
-                        if (mapCssTagChecker.getErrorsForPrimitive(n, false).isEmpty()) {
-                            // Or a legacy tagchecker ignore rule
-                            if (!TagChecker.isTagIgnored(key, value)) {
-                                ok = !errors.add(key +"="+ value + " - " + obj.getInt("count_all"));
-                            }
-                        }
-                    }
-                    System.out.println(ok ? "OK" : "KO");
-                }
-            }
-        }
-        for (String error : errors) {
-            System.err.println(error);
-        }
-        assertTrue(errors.toString(), errors.isEmpty());
-    }
-}
Index: /trunk/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java
===================================================================
--- /trunk/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java	(revision 9501)
+++ /trunk/test/functional/org/openstreetmap/josm/data/osm/TaginfoTestIT.java	(revision 9501)
@@ -0,0 +1,85 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.data.osm;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.json.Json;
+import javax.json.JsonObject;
+import javax.json.JsonReader;
+import javax.json.JsonValue;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker;
+import org.openstreetmap.josm.data.validation.tests.TagChecker;
+import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
+import org.openstreetmap.josm.gui.tagging.presets.TaggingPresets;
+import org.openstreetmap.josm.tools.HttpClient;
+import org.xml.sax.SAXException;
+
+/**
+ * Various integration tests with Taginfo.
+ */
+public class TaginfoTestIT {
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUp() {
+        JOSMFixture.createFunctionalTestFixture().init();
+    }
+
+    /**
+     * Checks that popular tags are known (i.e included in internal presets, or deprecated, or explicitely ignored)
+     * @throws SAXException if any XML parsing error occurs
+     * @throws IOException if any I/O error occurs
+     * @throws ParseException if any MapCSS parsing error occurs
+     */
+    @Test
+    public void checkPopularTags() throws SAXException, IOException, ParseException {
+        TaggingPresets.readFromPreferences();
+        new TagChecker().initialize();
+        MapCSSTagChecker mapCssTagChecker = new MapCSSTagChecker();
+        mapCssTagChecker.addMapCSS("resource://data/validator/deprecated.mapcss");
+
+        List<String> errors = new ArrayList<>();
+        try (InputStream in = HttpClient.create(new URL("https://taginfo.openstreetmap.org/api/4/tags/popular")).connect().getContent();
+             JsonReader reader = Json.createReader(in)) {
+            for (JsonValue item : reader.readObject().getJsonArray("data")) {
+                JsonObject obj = (JsonObject) item;
+                // Only consider tags with wiki pages
+                if (obj.getInt("in_wiki") == 1) {
+                    String key = obj.getString("key");
+                    String value = obj.getString("value");
+                    System.out.print("Checking "+key+"="+value+" ... ");
+                    boolean ok = true;
+                    // Check if tag is in internal presets
+                    if (!TagChecker.isTagInPresets(key, value)) {
+                        // If not, check if we have either a deprecated mapcss test for it
+                        Node n = new Node();
+                        n.put(key, value);
+                        if (mapCssTagChecker.getErrorsForPrimitive(n, false).isEmpty()) {
+                            // Or a legacy tagchecker ignore rule
+                            if (!TagChecker.isTagIgnored(key, value)) {
+                                ok = !errors.add(key +"="+ value + " - " + obj.getInt("count_all"));
+                            }
+                        }
+                    }
+                    System.out.println(ok ? "OK" : "KO");
+                }
+            }
+        }
+        for (String error : errors) {
+            System.err.println(error);
+        }
+        assertTrue(errors.toString(), errors.isEmpty());
+    }
+}
Index: unk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java	(revision 9500)
+++ 	(revision )
@@ -1,99 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.preferences.map;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
-import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
-import org.openstreetmap.josm.gui.mappaint.StyleKeys;
-import org.openstreetmap.josm.gui.mappaint.StyleSource;
-import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
-import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.AssignmentInstruction;
-import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
-import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
-import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
-import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
-
-/**
- * Unit tests of {@link MapPaintPreference} class.
- */
-public class MapPaintPreferenceTest {
-
-    /**
-     * Global timeout applied to all test methods.
-     */
-    @Rule
-    public Timeout globalTimeout = Timeout.seconds(10*60);
-
-    /**
-     * Setup test.
-     */
-    @BeforeClass
-    public static void setUpBeforeClass() {
-        JOSMFixture.createUnitTestFixture().init();
-    }
-
-    /**
-     * Test that available map paint styles are valid.
-     * @throws IOException if any I/O error occurs
-     * @throws ParseException if the config file does not match MapCSS syntax
-     */
-    @Test
-    public void testValidityOfAvailableStyles() throws ParseException, IOException {
-        Collection<ExtendedSourceEntry> sources = new MapPaintPreference.MapPaintSourceEditor()
-                .loadAndGetAvailableSources();
-        assertFalse(sources.isEmpty());
-        Map<String, Collection<Throwable>> allErrors = new HashMap<>();
-        Map<String, Collection<String>> allWarnings = new HashMap<>();
-        for (ExtendedSourceEntry source : sources) {
-            // Do not validate XML styles
-            if (!"xml".equalsIgnoreCase(source.styleType)) {
-                System.out.println(source.url);
-                StyleSource style = MapPaintStyles.addStyle(source);
-                if (style instanceof MapCSSStyleSource) {
-                    // Force loading of all icons to detect missing ones
-                    for (MapCSSRule rule : ((MapCSSStyleSource) style).rules) {
-                        for (Instruction instruction : rule.declaration.instructions) {
-                            if (instruction instanceof AssignmentInstruction) {
-                                AssignmentInstruction ai = (AssignmentInstruction) instruction;
-                                if (StyleKeys.ICON_IMAGE.equals(ai.key)
-                                 || StyleKeys.FILL_IMAGE.equals(ai.key)
-                                 || StyleKeys.REPEAT_IMAGE.equals(ai.key)) {
-                                    if (ai.val instanceof String) {
-                                        MapPaintStyles.getIconProvider(new IconReference((String) ai.val, style), true);
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-                if (style != null) {
-                    System.out.println(style.isValid() ? " => OK" : " => KO");
-                    Collection<Throwable> errors = style.getErrors();
-                    Collection<String> warnings = style.getWarnings();
-                    if (!errors.isEmpty()) {
-                        allErrors.put(source.url, errors);
-                    }
-                    if (!warnings.isEmpty()) {
-                        allWarnings.put(source.url, warnings);
-                    }
-                } else {
-                    allWarnings.put(source.url, Collections.singleton("MapPaintStyles.addStyle() returned null"));
-                }
-            }
-        }
-        assertTrue(allErrors.toString()+"\n"+allWarnings.toString(), allErrors.isEmpty() && allWarnings.isEmpty());
-    }
-}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java	(revision 9501)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java	(revision 9501)
@@ -0,0 +1,99 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.preferences.map;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.Timeout;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
+import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
+import org.openstreetmap.josm.gui.mappaint.StyleKeys;
+import org.openstreetmap.josm.gui.mappaint.StyleSource;
+import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction;
+import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.AssignmentInstruction;
+import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule;
+import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
+import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException;
+import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
+
+/**
+ * Integration tests of {@link MapPaintPreference} class.
+ */
+public class MapPaintPreferenceTestIT {
+
+    /**
+     * Global timeout applied to all test methods.
+     */
+    @Rule
+    public Timeout globalTimeout = Timeout.seconds(10*60);
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test that available map paint styles are valid.
+     * @throws IOException if any I/O error occurs
+     * @throws ParseException if the config file does not match MapCSS syntax
+     */
+    @Test
+    public void testValidityOfAvailableStyles() throws ParseException, IOException {
+        Collection<ExtendedSourceEntry> sources = new MapPaintPreference.MapPaintSourceEditor()
+                .loadAndGetAvailableSources();
+        assertFalse(sources.isEmpty());
+        Map<String, Collection<Throwable>> allErrors = new HashMap<>();
+        Map<String, Collection<String>> allWarnings = new HashMap<>();
+        for (ExtendedSourceEntry source : sources) {
+            // Do not validate XML styles
+            if (!"xml".equalsIgnoreCase(source.styleType)) {
+                System.out.println(source.url);
+                StyleSource style = MapPaintStyles.addStyle(source);
+                if (style instanceof MapCSSStyleSource) {
+                    // Force loading of all icons to detect missing ones
+                    for (MapCSSRule rule : ((MapCSSStyleSource) style).rules) {
+                        for (Instruction instruction : rule.declaration.instructions) {
+                            if (instruction instanceof AssignmentInstruction) {
+                                AssignmentInstruction ai = (AssignmentInstruction) instruction;
+                                if (StyleKeys.ICON_IMAGE.equals(ai.key)
+                                 || StyleKeys.FILL_IMAGE.equals(ai.key)
+                                 || StyleKeys.REPEAT_IMAGE.equals(ai.key)) {
+                                    if (ai.val instanceof String) {
+                                        MapPaintStyles.getIconProvider(new IconReference((String) ai.val, style), true);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                if (style != null) {
+                    System.out.println(style.isValid() ? " => OK" : " => KO");
+                    Collection<Throwable> errors = style.getErrors();
+                    Collection<String> warnings = style.getWarnings();
+                    if (!errors.isEmpty()) {
+                        allErrors.put(source.url, errors);
+                    }
+                    if (!warnings.isEmpty()) {
+                        allWarnings.put(source.url, warnings);
+                    }
+                } else {
+                    allWarnings.put(source.url, Collections.singleton("MapPaintStyles.addStyle() returned null"));
+                }
+            }
+        }
+        assertTrue(allErrors.toString()+"\n"+allWarnings.toString(), allErrors.isEmpty() && allWarnings.isEmpty());
+    }
+}
Index: unk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java	(revision 9500)
+++ 	(revision )
@@ -1,96 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.gui.preferences.map;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
-import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
-import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader;
-import org.xml.sax.SAXException;
-
-/**
- * Unit tests of {@link TaggingPresetPreference} class.
- */
-public class TaggingPresetPreferenceTest {
-
-    /**
-     * Global timeout applied to all test methods.
-     */
-    @Rule
-    public Timeout globalTimeout = Timeout.seconds(10*60);
-
-    /**
-     * Setup test.
-     */
-    @BeforeClass
-    public static void setUpBeforeClass() {
-        JOSMFixture.createUnitTestFixture().init();
-    }
-
-    /**
-     * Test that available tagging presets are valid.
-     */
-    @Test
-    public void testValidityOfAvailablePresets() {
-        Collection<ExtendedSourceEntry> sources = new TaggingPresetPreference.TaggingPresetSourceEditor()
-                .loadAndGetAvailableSources();
-        assertFalse(sources.isEmpty());
-        // Double traditional timeouts to avoid random problems
-        Main.pref.putInteger("socket.timeout.connect", 30);
-        Main.pref.putInteger("socket.timeout.read", 60);
-        Collection<Throwable> allErrors = new ArrayList<>();
-        Set<String> allMessages = new HashSet<>();
-        for (ExtendedSourceEntry source : sources) {
-            System.out.println(source.url);
-            try {
-                testPresets(allMessages, source);
-            } catch (IOException e) {
-                try {
-                    Main.warn(e);
-                    // try again in case of temporary network error
-                    testPresets(allMessages, source);
-                } catch (SAXException | IOException e1) {
-                    e.printStackTrace();
-                    allErrors.add(e1);
-                    System.out.println(" => KO");
-                }
-            } catch (SAXException e) {
-                e.printStackTrace();
-                allErrors.add(e);
-                System.out.println(" => KO");
-            }
-        }
-        assertTrue(allErrors.isEmpty());
-        assertTrue(allMessages.isEmpty());
-    }
-
-    private static void testPresets(Set<String> allMessages, ExtendedSourceEntry source) throws SAXException, IOException {
-        Collection<TaggingPreset> presets = TaggingPresetReader.readAll(source.url, true);
-        assertFalse(presets.isEmpty());
-        Collection<String> errorsAndWarnings = Main.getLastErrorAndWarnings();
-        boolean error = false;
-        for (String message : errorsAndWarnings) {
-            if (message.contains(TaggingPreset.PRESET_ICON_ERROR_MSG_PREFIX)) {
-                error = true;
-                allMessages.add(message);
-            }
-        }
-        System.out.println(error ? " => KO" : " => OK");
-        if (error) {
-            Main.clearLastErrorAndWarnings();
-        }
-    }
-}
Index: /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java	(revision 9501)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java	(revision 9501)
@@ -0,0 +1,96 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.preferences.map;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.Timeout;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
+import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
+import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader;
+import org.xml.sax.SAXException;
+
+/**
+ * Integration tests of {@link TaggingPresetPreference} class.
+ */
+public class TaggingPresetPreferenceTestIT {
+
+    /**
+     * Global timeout applied to all test methods.
+     */
+    @Rule
+    public Timeout globalTimeout = Timeout.seconds(10*60);
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUpBeforeClass() {
+        JOSMFixture.createUnitTestFixture().init();
+    }
+
+    /**
+     * Test that available tagging presets are valid.
+     */
+    @Test
+    public void testValidityOfAvailablePresets() {
+        Collection<ExtendedSourceEntry> sources = new TaggingPresetPreference.TaggingPresetSourceEditor()
+                .loadAndGetAvailableSources();
+        assertFalse(sources.isEmpty());
+        // Double traditional timeouts to avoid random problems
+        Main.pref.putInteger("socket.timeout.connect", 30);
+        Main.pref.putInteger("socket.timeout.read", 60);
+        Collection<Throwable> allErrors = new ArrayList<>();
+        Set<String> allMessages = new HashSet<>();
+        for (ExtendedSourceEntry source : sources) {
+            System.out.println(source.url);
+            try {
+                testPresets(allMessages, source);
+            } catch (IOException e) {
+                try {
+                    Main.warn(e);
+                    // try again in case of temporary network error
+                    testPresets(allMessages, source);
+                } catch (SAXException | IOException e1) {
+                    e.printStackTrace();
+                    allErrors.add(e1);
+                    System.out.println(" => KO");
+                }
+            } catch (SAXException e) {
+                e.printStackTrace();
+                allErrors.add(e);
+                System.out.println(" => KO");
+            }
+        }
+        assertTrue(allErrors.isEmpty());
+        assertTrue(allMessages.isEmpty());
+    }
+
+    private static void testPresets(Set<String> allMessages, ExtendedSourceEntry source) throws SAXException, IOException {
+        Collection<TaggingPreset> presets = TaggingPresetReader.readAll(source.url, true);
+        assertFalse(presets.isEmpty());
+        Collection<String> errorsAndWarnings = Main.getLastErrorAndWarnings();
+        boolean error = false;
+        for (String message : errorsAndWarnings) {
+            if (message.contains(TaggingPreset.PRESET_ICON_ERROR_MSG_PREFIX)) {
+                error = true;
+                allMessages.add(message);
+            }
+        }
+        System.out.println(error ? " => KO" : " => OK");
+        if (error) {
+            Main.clearLastErrorAndWarnings();
+        }
+    }
+}
Index: unk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTest.java	(revision 9500)
+++ 	(revision )
@@ -1,85 +1,0 @@
-// License: GPL. For details, see LICENSE file.
-package org.openstreetmap.josm.plugins;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
-import org.openstreetmap.josm.JOSMFixture;
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
-
-/**
- * Unit tests of {@link PluginHandler} class.
- */
-public class PluginHandlerTest {
-
-    /**
-     * Global timeout applied to all test methods.
-     */
-    @Rule
-    public Timeout globalTimeout = Timeout.seconds(10*60);
-
-    /**
-     * Setup test.
-     */
-    @BeforeClass
-    public static void setUp() {
-        JOSMFixture.createUnitTestFixture().init(true);
-    }
-
-    /**
-     * Test that available plugins rules can be loaded.
-     */
-    @Test
-    public void testValidityOfAvailablePlugins() {
-        // Download complete list of plugins
-        ReadRemotePluginInformationTask pluginInfoDownloadTask = new ReadRemotePluginInformationTask(
-                Main.pref.getOnlinePluginSites());
-        pluginInfoDownloadTask.run();
-        List<PluginInformation> plugins = pluginInfoDownloadTask.getAvailablePlugins();
-        System.out.println("Original plugin list contains " + plugins.size() + " plugins");
-        assertFalse(plugins.isEmpty());
-        PluginInformation info = plugins.get(0);
-        assertFalse(info.getName().isEmpty());
-        assertFalse(info.getClass().getName().isEmpty());
-
-        // Filter deprecated and unmaintained ones
-        List<String> uncooperatingPlugins = Arrays.asList("ebdirigo");
-        Set<String> deprecatedPlugins = PluginHandler.getDeprecatedAndUnmaintainedPlugins();
-        for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) {
-            PluginInformation pi = it.next();
-            if (deprecatedPlugins.contains(pi.name) || uncooperatingPlugins.contains(pi.name)) {
-                System.out.println("Ignoring " + pi.name + " (deprecated, unmaintained, or uncooperative)");
-                it.remove();
-            }
-        }
-        System.out.println("Filtered plugin list contains " + plugins.size() + " plugins");
-
-        // Update the locally installed plugins
-        PluginDownloadTask pluginDownloadTask = new PluginDownloadTask(NullProgressMonitor.INSTANCE, plugins, null);
-        pluginDownloadTask.run();
-        assertTrue(pluginDownloadTask.getFailedPlugins().toString(), pluginDownloadTask.getFailedPlugins().isEmpty());
-        assertEquals(plugins.size(), pluginDownloadTask.getDownloadedPlugins().size());
-
-        // Update Plugin info for downloaded plugins
-        PluginHandler.refreshLocalUpdatedPluginInfo(pluginDownloadTask.getDownloadedPlugins());
-
-        // Load early plugins
-        PluginHandler.loadEarlyPlugins(null, plugins, null);
-
-        // Load late plugins
-        PluginHandler.loadLatePlugins(null, plugins, null);
-
-        assertTrue(PluginHandler.pluginLoadingExceptions.toString(), PluginHandler.pluginLoadingExceptions.isEmpty());
-    }
-}
Index: /trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java	(revision 9501)
+++ /trunk/test/unit/org/openstreetmap/josm/plugins/PluginHandlerTestIT.java	(revision 9501)
@@ -0,0 +1,85 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.Timeout;
+import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
+
+/**
+ * Integration tests of {@link PluginHandler} class.
+ */
+public class PluginHandlerTestIT {
+
+    /**
+     * Global timeout applied to all test methods.
+     */
+    @Rule
+    public Timeout globalTimeout = Timeout.seconds(10*60);
+
+    /**
+     * Setup test.
+     */
+    @BeforeClass
+    public static void setUp() {
+        JOSMFixture.createUnitTestFixture().init(true);
+    }
+
+    /**
+     * Test that available plugins rules can be loaded.
+     */
+    @Test
+    public void testValidityOfAvailablePlugins() {
+        // Download complete list of plugins
+        ReadRemotePluginInformationTask pluginInfoDownloadTask = new ReadRemotePluginInformationTask(
+                Main.pref.getOnlinePluginSites());
+        pluginInfoDownloadTask.run();
+        List<PluginInformation> plugins = pluginInfoDownloadTask.getAvailablePlugins();
+        System.out.println("Original plugin list contains " + plugins.size() + " plugins");
+        assertFalse(plugins.isEmpty());
+        PluginInformation info = plugins.get(0);
+        assertFalse(info.getName().isEmpty());
+        assertFalse(info.getClass().getName().isEmpty());
+
+        // Filter deprecated and unmaintained ones
+        List<String> uncooperatingPlugins = Arrays.asList("ebdirigo");
+        Set<String> deprecatedPlugins = PluginHandler.getDeprecatedAndUnmaintainedPlugins();
+        for (Iterator<PluginInformation> it = plugins.iterator(); it.hasNext();) {
+            PluginInformation pi = it.next();
+            if (deprecatedPlugins.contains(pi.name) || uncooperatingPlugins.contains(pi.name)) {
+                System.out.println("Ignoring " + pi.name + " (deprecated, unmaintained, or uncooperative)");
+                it.remove();
+            }
+        }
+        System.out.println("Filtered plugin list contains " + plugins.size() + " plugins");
+
+        // Update the locally installed plugins
+        PluginDownloadTask pluginDownloadTask = new PluginDownloadTask(NullProgressMonitor.INSTANCE, plugins, null);
+        pluginDownloadTask.run();
+        assertTrue(pluginDownloadTask.getFailedPlugins().toString(), pluginDownloadTask.getFailedPlugins().isEmpty());
+        assertEquals(plugins.size(), pluginDownloadTask.getDownloadedPlugins().size());
+
+        // Update Plugin info for downloaded plugins
+        PluginHandler.refreshLocalUpdatedPluginInfo(pluginDownloadTask.getDownloadedPlugins());
+
+        // Load early plugins
+        PluginHandler.loadEarlyPlugins(null, plugins, null);
+
+        // Load late plugins
+        PluginHandler.loadLatePlugins(null, plugins, null);
+
+        assertTrue(PluginHandler.pluginLoadingExceptions.toString(), PluginHandler.pluginLoadingExceptions.isEmpty());
+    }
+}
