Changeset 14126 in josm for trunk/test/unit/org
- Timestamp:
- 2018-08-11T19:08:26+02:00 (6 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/ExitActionTest.java
r14081 r14126 8 8 import org.junit.contrib.java.lang.system.ExpectedSystemExit; 9 9 import org.openstreetmap.josm.TestUtils; 10 import org.openstreetmap.josm.data.cache.JCSCacheManager; 10 11 import org.openstreetmap.josm.gui.MainApplication; 11 12 import org.openstreetmap.josm.gui.progress.swing.ProgressMonitorExecutor; … … 46 47 boolean[] workerShutdownCalled = {false}; 47 48 boolean[] workerShutdownNowCalled = {false}; 48 boolean[] imageProviderShutdownCalled = {false}; 49 boolean[] imageProviderShutdownCalledNowFalse = {false}; 50 boolean[] imageProviderShutdownCalledNowTrue = {false}; 51 boolean[] jcsCacheManagerShutdownCalled = {false}; 49 52 50 53 // critically we don't proceed into the actual implementation in any of these mock methods - … … 70 73 new MockUp<ImageProvider>() { 71 74 @Mock 75 private void shutdown(Invocation invocation, boolean now) { 76 if (now) { 77 // should have already been called with now = false 78 assertTrue(imageProviderShutdownCalledNowFalse[0]); 79 imageProviderShutdownCalledNowTrue[0] = true; 80 } else { 81 imageProviderShutdownCalledNowFalse[0] = true; 82 } 83 } 84 }; 85 new MockUp<JCSCacheManager>() { 86 @Mock 72 87 private void shutdown(Invocation invocation) { 73 imageProviderShutdownCalled[0] = true;88 jcsCacheManagerShutdownCalled[0] = true; 74 89 } 75 90 }; … … 77 92 // No layer 78 93 79 new ExitAction().actionPerformed(null); 80 81 assertTrue(workerShutdownCalled[0]); 82 assertTrue(workerShutdownNowCalled[0]); 83 assertTrue(imageProviderShutdownCalled[0]); 94 try { 95 new ExitAction().actionPerformed(null); 96 } finally { 97 // ExpectedSystemExit presumably works using an exception, so executing anything after the 98 // previous line requires it to be put in a finally block 99 assertTrue(workerShutdownCalled[0]); 100 assertTrue(workerShutdownNowCalled[0]); 101 assertTrue(imageProviderShutdownCalledNowFalse[0]); 102 assertTrue(imageProviderShutdownCalledNowTrue[0]); 103 assertTrue(jcsCacheManagerShutdownCalled[0]); 104 } 84 105 } 85 106 } -
trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackActionTest.java
r14116 r14126 46 46 */ 47 47 @Test 48 @Ignore("Test fails since r14052 - see #16590")49 48 public void testTMSLayer() throws Exception { 50 49 final TileSourceRule tileSourceRule = this.test.getTileSourceRule();
Note:
See TracChangeset
for help on using the changeset viewer.