Index: trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 14125)
+++ trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java	(revision 14126)
@@ -8,4 +8,5 @@
 import org.junit.contrib.java.lang.system.ExpectedSystemExit;
 import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.data.cache.JCSCacheManager;
 import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor;
@@ -46,5 +47,7 @@
         boolean[] workerShutdownCalled = {false};
         boolean[] workerShutdownNowCalled = {false};
-        boolean[] imageProviderShutdownCalled = {false};
+        boolean[] imageProviderShutdownCalledNowFalse = {false};
+        boolean[] imageProviderShutdownCalledNowTrue = {false};
+        boolean[] jcsCacheManagerShutdownCalled = {false};
 
         // critically we don't proceed into the actual implementation in any of these mock methods -
@@ -70,6 +73,18 @@
         new MockUp<ImageProvider>() {
             @Mock
+            private void shutdown(Invocation invocation, boolean now) {
+                if (now) {
+                    // should have already been called with now = false
+                    assertTrue(imageProviderShutdownCalledNowFalse[0]);
+                    imageProviderShutdownCalledNowTrue[0] = true;
+                } else {
+                    imageProviderShutdownCalledNowFalse[0] = true;
+                }
+            }
+        };
+        new MockUp<JCSCacheManager>() {
+            @Mock
             private void shutdown(Invocation invocation) {
-                imageProviderShutdownCalled[0] = true;
+                jcsCacheManagerShutdownCalled[0] = true;
             }
         };
@@ -77,9 +92,15 @@
         // No layer
 
-        new ExitAction().actionPerformed(null);
-
-        assertTrue(workerShutdownCalled[0]);
-        assertTrue(workerShutdownNowCalled[0]);
-        assertTrue(imageProviderShutdownCalled[0]);
+        try {
+            new ExitAction().actionPerformed(null);
+        } finally {
+            // ExpectedSystemExit presumably works using an exception, so executing anything after the
+            // previous line requires it to be put in a finally block
+            assertTrue(workerShutdownCalled[0]);
+            assertTrue(workerShutdownNowCalled[0]);
+            assertTrue(imageProviderShutdownCalledNowFalse[0]);
+            assertTrue(imageProviderShutdownCalledNowTrue[0]);
+            assertTrue(jcsCacheManagerShutdownCalled[0]);
+        }
     }
 }
Index: trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java	(revision 14125)
+++ trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java	(revision 14126)
@@ -46,5 +46,4 @@
      */
     @Test
-    @Ignore("Test fails since r14052 - see #16590")
     public void testTMSLayer() throws Exception {
         final TileSourceRule tileSourceRule = this.test.getTileSourceRule();
