Ignore:
Timestamp:
2017-08-22T22:26:32+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - deprecate all Main logging methods and introduce suitable replacements in Logging for most of them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandlerTest.java

    r10945 r12620  
    1515import org.junit.Rule;
    1616import org.junit.Test;
    17 import org.openstreetmap.josm.Main;
    1817import org.openstreetmap.josm.data.Bounds;
    1918import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    2019import org.openstreetmap.josm.testutils.JOSMTestRules;
     20import org.openstreetmap.josm.tools.Logging;
    2121
    2222import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    120120    @Test
    121121    public void testRunExceptionFuture() {
    122         Main.clearLastErrorAndWarnings();
     122        Logging.clearLastErrorAndWarnings();
    123123        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"));
    126126    }
    127127
     
    131131    @Test
    132132    public void testRunNoError() {
    133         Main.clearLastErrorAndWarnings();
     133        Logging.clearLastErrorAndWarnings();
    134134        new PostDownloadHandler(newTask(Collections.emptyList()), newFuture(null)).run();
    135         assertTrue(Main.getLastErrorAndWarnings().toString(), Main.getLastErrorAndWarnings().isEmpty());
     135        assertTrue(Logging.getLastErrorAndWarnings().toString(), Logging.getLastErrorAndWarnings().isEmpty());
    136136    }
    137137
     
    141141    @Test
    142142    public void testRunOneError() {
    143         Main.clearLastErrorAndWarnings();
     143        Logging.clearLastErrorAndWarnings();
    144144        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());
    146146    }
    147147
     
    151151    @Test
    152152    public void testRunMultipleErrors() {
    153         Main.clearLastErrorAndWarnings();
     153        Logging.clearLastErrorAndWarnings();
    154154        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"));
    157157    }
    158158}
Note: See TracChangeset for help on using the changeset viewer.