source: josm/trunk/test/unit/org/openstreetmap/josm/gui/io/SaveLayerInfoTest.java@ 9763

Last change on this file since 9763 was 9763, checked in by bastiK, 8 years ago

see #12508 - add missing fixtures for unit test

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.io;
3
4import static org.junit.Assert.assertEquals;
5import static org.junit.Assert.assertNull;
6
7import java.io.File;
8
9import org.junit.BeforeClass;
10import org.junit.Test;
11import org.openstreetmap.josm.JOSMFixture;
12import org.openstreetmap.josm.data.osm.DataSet;
13import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer;
14import org.openstreetmap.josm.gui.layer.OsmDataLayer;
15
16/**
17 * Unit tests of {@link SaveLayerInfo} class.
18 */
19public class SaveLayerInfoTest {
20 /**
21 * Setup test.
22 */
23 @BeforeClass
24 public static void setUpBeforeClass() {
25 JOSMFixture.createUnitTestFixture().init(false);
26 }
27
28 /**
29 * Test of {@link SaveLayerInfo} class - null case.
30 */
31 @Test(expected = IllegalArgumentException.class)
32 public void testSaveLayerInfoNull() {
33 new SaveLayerInfo(null);
34 }
35
36 /**
37 * Test of {@link SaveLayerInfo} class - nominal case.
38 */
39 @Test
40 public void testSaveLayerInfoNominal() {
41 File file = new File("test");
42 String name = "layername";
43 AbstractModifiableLayer layer = new OsmDataLayer(new DataSet(), name, file);
44 SaveLayerInfo sli = new SaveLayerInfo(layer);
45 assertEquals(file, sli.getFile());
46 assertEquals(layer, sli.getLayer());
47 assertEquals(name, sli.getName());
48 assertNull(sli.getSaveState());
49 assertNull(sli.getUploadState());
50 }
51}
Note: See TracBrowser for help on using the repository browser.