Changeset 10200 in josm for trunk/test


Ignore:
Timestamp:
2016-05-13T03:11:46+02:00 (6 years ago)
Author:
Don-vip
Message:

add more unit tests

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

Legend:

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

    r8857 r10200  
    77import static org.junit.Assert.assertTrue;
    88
     9import java.awt.Dimension;
     10import java.awt.Point;
    911import java.util.Collection;
    1012
     13import org.junit.BeforeClass;
    1114import org.junit.Test;
    1215import org.openstreetmap.josm.Main.DownloadParamType;
     16import org.openstreetmap.josm.gui.MainApplication;
     17import org.openstreetmap.josm.tools.WindowGeometry;
    1318
    1419/**
     
    1621 */
    1722public class MainTest {
     23
     24    /**
     25     * Setup test.
     26     */
     27    @BeforeClass
     28    public static void setUp() {
     29        JOSMFixture.createUnitTestFixture().init();
     30    }
    1831
    1932    /**
     
    2841        assertEquals(DownloadParamType.httpUrl, DownloadParamType.paramType("http://somewhere.com/data.osm"));
    2942        assertEquals(DownloadParamType.httpUrl, DownloadParamType.paramType("https://somewhere.com/data.osm"));
     43    }
     44
     45    /**
     46     * Unit test of {@code Main#preConstructorInit}.
     47     */
     48    @Test
     49    public void testPreConstructorInit() {
     50        Main.preConstructorInit(MainApplication.buildCommandLineArgumentMap(new String[0]));
     51        Main.preConstructorInit(MainApplication.buildCommandLineArgumentMap(new String[]{"--geometry=400x300+10+5", "--no-maximize"}));
     52        assertEquals(new WindowGeometry(new Point(10, 5), new Dimension(400, 300)), Main.geometry);
    3053    }
    3154
Note: See TracChangeset for help on using the changeset viewer.