Changeset 12620 in josm for trunk/test/unit/org/openstreetmap/josm/actions
- Timestamp:
- 2017-08-22T22:26:32+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandlerTest.java
r10945 r12620 15 15 import org.junit.Rule; 16 16 import org.junit.Test; 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.data.Bounds; 19 18 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 20 19 import org.openstreetmap.josm.testutils.JOSMTestRules; 20 import org.openstreetmap.josm.tools.Logging; 21 21 22 22 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; … … 120 120 @Test 121 121 public void testRunExceptionFuture() { 122 Main.clearLastErrorAndWarnings();122 Logging.clearLastErrorAndWarnings(); 123 123 new PostDownloadHandler(null, newFuture("testRunExceptionFuture")).run(); 124 assertTrue( Main.getLastErrorAndWarnings().toString(),125 Main.getLastErrorAndWarnings().contains("E: java.util.concurrent.ExecutionException: testRunExceptionFuture"));124 assertTrue(Logging.getLastErrorAndWarnings().toString(), 125 Logging.getLastErrorAndWarnings().contains("E: java.util.concurrent.ExecutionException: testRunExceptionFuture")); 126 126 } 127 127 … … 131 131 @Test 132 132 public void testRunNoError() { 133 Main.clearLastErrorAndWarnings();133 Logging.clearLastErrorAndWarnings(); 134 134 new PostDownloadHandler(newTask(Collections.emptyList()), newFuture(null)).run(); 135 assertTrue( Main.getLastErrorAndWarnings().toString(),Main.getLastErrorAndWarnings().isEmpty());135 assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().isEmpty()); 136 136 } 137 137 … … 141 141 @Test 142 142 public void testRunOneError() { 143 Main.clearLastErrorAndWarnings();143 Logging.clearLastErrorAndWarnings(); 144 144 new PostDownloadHandler(newTask(Collections.singletonList(new Object())), newFuture(null)).run(); 145 assertTrue( Main.getLastErrorAndWarnings().toString(),Main.getLastErrorAndWarnings().isEmpty());145 assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().isEmpty()); 146 146 } 147 147 … … 151 151 @Test 152 152 public void testRunMultipleErrors() { 153 Main.clearLastErrorAndWarnings();153 Logging.clearLastErrorAndWarnings(); 154 154 new PostDownloadHandler(newTask(Arrays.asList("foo", new Exception("bar"), new Object())), newFuture(null)).run(); 155 assertTrue( Main.getLastErrorAndWarnings().toString(),156 Main.getLastErrorAndWarnings().contains("E: java.lang.Exception: bar"));155 assertTrue(Logging.getLastErrorAndWarnings().toString(), 156 Logging.getLastErrorAndWarnings().contains("E: java.lang.Exception: bar")); 157 157 } 158 158 }
Note:
See TracChangeset
for help on using the changeset viewer.