Ticket #13453: patch-test-layer-set-name.patch

File patch-test-layer-set-name.patch, 951 bytes (added by michael2402, 5 years ago)
  • test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java

    diff --git a/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java b/test/unit/org/openstreetmap/josm/gui/layer/LayerTest.java
    index f7127f8..0eb25c9 100644
    a b public class LayerTest { 
    9696    public void testSetName() {
    9797        testLayer.setName("Test Layer2");
    9898        assertEquals("Test Layer2", testLayer.getName());
     99
     100        testLayer = new LayerManagerTest.TestLayer() {
     101            @Override
     102            public AbstractProperty<Color> getColorProperty() {
     103                return new ColorProperty("test", Color.RED);
     104            };
     105        };
     106
     107        testLayer.setName("Test Layer2");
     108        testLayer.setName(null);
     109        assertEquals("", testLayer.getName());
     110        testLayer.setName("Test Layer3");
     111        assertEquals("Test Layer3", testLayer.getName());
    99112    }
    100113
    101114    /**