Index: /trunk/src/org/openstreetmap/josm/tools/Logging.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Logging.java	(revision 14061)
+++ /trunk/src/org/openstreetmap/josm/tools/Logging.java	(revision 14062)
@@ -85,5 +85,5 @@
          * Set output stream to one acquired from calling outputStreamSupplier
          */
-        public void reacquireOutputStream() {
+        public synchronized void reacquireOutputStream() {
             final OutputStream reacquiredStream = this.outputStreamSupplier.get();
 
Index: /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 14061)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadAlongTrackActionTest.java	(revision 14062)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.layer.gpx;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -15,4 +16,7 @@
 import org.openstreetmap.josm.io.GpxReaderTest;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.mockers.HelpAwareOptionPaneMocker;
+
+import com.google.common.collect.ImmutableMap;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -31,4 +35,16 @@
 
     private static PleaseWaitRunnable createTask(String file) throws Exception {
+        // click "Download" when presented with the appropriate HelpAwareOptionPane
+        final HelpAwareOptionPaneMocker haMocker = new HelpAwareOptionPaneMocker(ImmutableMap.of(
+            "DownloadAlongPanel", "Download"
+        )) {
+            // expected "message" for HelpAwareOptionPane call is not a simple string, so instead
+            // just detect the class name of the message object
+            @Override
+            protected String getStringFromMessage(final Object message) {
+                return message instanceof String ? (String) message : message.getClass().getSimpleName();
+            }
+        };
+
         final OsmDataLayer layer = new OsmDataLayer(new DataSet(), DownloadAlongTrackActionTest.class.getName(), null);
         try {
@@ -36,5 +52,13 @@
             // Perform action
             final GpxData gpx = GpxReaderTest.parseGpxData(TestUtils.getTestDataRoot() + file);
-            return new DownloadAlongTrackAction(gpx).createTask();
+            final PleaseWaitRunnable retval = new DownloadAlongTrackAction(gpx).createTask();
+
+            // assert that we were indeed presented with the expected HelpAwareOptionPane
+            assertEquals(1, haMocker.getInvocationLog().size());
+            assertEquals(0, haMocker.getInvocationLog().get(0)[0]);
+            assertEquals("DownloadAlongPanel", haMocker.getInvocationLog().get(0)[1]);
+            assertEquals("Download from OSM along this track", haMocker.getInvocationLog().get(0)[2]);
+
+            return retval;
         } finally {
             // Ensure we clean the place before leaving, even if test fails.
Index: /trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 14061)
+++ /trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceHighLevelTest.java	(revision 14062)
@@ -232,5 +232,5 @@
         assertEquals(1, haMocker.getInvocationLog().size());
         Object[] invocationLogEntry = haMocker.getInvocationLog().get(0);
-        assertEquals(2, (int) invocationLogEntry[0]);
+        assertEquals(1, (int) invocationLogEntry[0]);
         assertEquals("Restart", invocationLogEntry[2]);
 
@@ -354,5 +354,5 @@
         assertEquals(1, haMocker.getInvocationLog().size());
         Object[] invocationLogEntry = haMocker.getInvocationLog().get(0);
-        assertEquals(2, (int) invocationLogEntry[0]);
+        assertEquals(1, (int) invocationLogEntry[0]);
         assertEquals("Restart", invocationLogEntry[2]);
 
Index: /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java	(revision 14061)
+++ /trunk/test/unit/org/openstreetmap/josm/testutils/mockers/HelpAwareOptionPaneMocker.java	(revision 14062)
@@ -101,6 +101,5 @@
                 ));
             }
-            // buttons are numbered with 1-based indexing
-            return optIndex.getAsInt() + 1;
+            return optIndex.getAsInt();
         }
     }
@@ -162,5 +161,5 @@
                     retval
                 ));
-            } else if (retval > (options == null ? 0 : options.length)) {  // NOTE 1-based indexing
+            } else if (retval > (options == null ? 0 : options.length-1)) {
                 fail(String.format(
                     "Invalid result for HelpAwareOptionPane: %s (in call with options = %s)",
