Changeset 10899 in josm for trunk/test


Ignore:
Timestamp:
2016-08-25T23:21:10+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #13318 - Clean up program startup (parameters, logging) - patch by michael2402 - gsoc-core

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/JOSMFixture.java

    r10876 r10899  
    2222import org.openstreetmap.josm.io.OsmApi;
    2323import org.openstreetmap.josm.tools.I18n;
     24import org.openstreetmap.josm.tools.Logging;
    2425
    2526/**
     
    99100        Main.platform.preStartupHook();
    100101
    101         Main.logLevel = 3;
     102        Logging.setLogLevel(Logging.LEVEL_INFO);
    102103        Main.pref.init(false);
    103104        String url = Main.pref.get("osm-server.url");
  • trunk/test/unit/org/openstreetmap/josm/MainTest.java

    r10340 r10899  
    33
    44import static org.junit.Assert.assertEquals;
    5 import static org.junit.Assert.assertFalse;
    65import static org.junit.Assert.assertNull;
    76import static org.junit.Assert.assertTrue;
     
    1211import org.junit.Test;
    1312import org.openstreetmap.josm.Main.DownloadParamType;
    14 import org.openstreetmap.josm.gui.MainApplication;
    1513
    1614import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    4341
    4442    /**
    45      * Unit test of {@code Main#preConstructorInit}.
    46      */
    47     @Test
    48     public void testPreConstructorInit() {
    49         Main.preConstructorInit(MainApplication.buildCommandLineArgumentMap(new String[0]));
    50         Main.preConstructorInit(MainApplication.buildCommandLineArgumentMap(new String[]{"--geometry=400x300+10+5", "--no-maximize"}));
    51         //assertEquals(new WindowGeometry(new Point(10, 5), new Dimension(400, 300)), Main.geometry); // FIXME see #12927
    52     }
    53 
    54     /**
    5543     * Unit tests on log messages.
    5644     */
     
    7866        assertTrue(warnings.contains("W: Warning message on one line"));
    7967        assertTrue(warnings.contains("W: First line of warning message on several lines"));
    80 
    81         int defaultLevel = Main.logLevel;
    82 
    83         // Check levels
    84         Main.logLevel = 5;
    85         assertTrue(Main.isTraceEnabled());
    86         assertTrue(Main.isDebugEnabled());
    87 
    88         Main.logLevel = 4;
    89         assertFalse(Main.isTraceEnabled());
    90         assertTrue(Main.isDebugEnabled());
    91 
    92         Main.logLevel = 3;
    93         assertFalse(Main.isTraceEnabled());
    94         assertFalse(Main.isDebugEnabled());
    95 
    96         Main.logLevel = defaultLevel;
    9768    }
    9869}
  • trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java

    r10876 r10899  
    2020import org.openstreetmap.josm.io.OsmTransferCanceledException;
    2121import org.openstreetmap.josm.tools.I18n;
     22import org.openstreetmap.josm.tools.Logging;
    2223import org.openstreetmap.josm.tools.MemoryManagerTest;
    2324import org.openstreetmap.josm.tools.date.DateUtils;
     
    182183        TimeZone.setDefault(DateUtils.UTC);
    183184        // Set log level to info
    184         Main.logLevel = 3;
     185        Logging.setLogLevel(Logging.LEVEL_INFO);
    185186
    186187        // Set up i18n
Note: See TracChangeset for help on using the changeset viewer.