Changeset 12718 in josm for trunk/test


Ignore:
Timestamp:
2017-09-04T00:50:22+02:00 (7 years ago)
Author:
Don-vip
Message:

see #13036 - see #15229 - see #15182 - make Commands depends only on a DataSet, not a Layer. This removes a lot of GUI dependencies

File:
1 edited

Legend:

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

    r12636 r12718  
    22package org.openstreetmap.josm.command;
    33
    4 import static org.junit.Assert.assertFalse;
    54import static org.junit.Assert.assertSame;
    6 import static org.junit.Assert.assertTrue;
    75
    86import java.util.Arrays;
     
    5048
    5149    /**
    52      * Test {@link Command#invalidBecauselayerRemoved(org.openstreetmap.josm.gui.layer.Layer)}
     50     * Test {@link Command#getLayer()}
     51     * @deprecated to be removed end of 2017
    5352     */
    5453    @Test
    55     public void testInvalidBecauselayerRemoved() {
    56         OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "test", null);
    57 
    58         Command command = new NopCommand();
    59         assertFalse(command.invalidBecauselayerRemoved(layer2));
    60         assertTrue(command.invalidBecauselayerRemoved(testData.layer));
    61 
    62         Command command2 = new NopCommand(layer2);
    63         assertTrue(command2.invalidBecauselayerRemoved(layer2));
    64         assertFalse(command2.invalidBecauselayerRemoved(testData.layer));
    65     }
    66 
    67     /**
    68      * Test {@link Command#getLayer()}
    69      */
    70     @Test
     54    @Deprecated
    7155    public void testGetLayer() {
    7256        OsmDataLayer layer2 = new OsmDataLayer(new DataSet(), "test", null);
    7357        Command command = new NopCommand();
    74         Command command2 = new NopCommand(layer2);
     58        Command command2 = new NopCommand(layer2.data);
    7559        assertSame(testData.layer, command.getLayer());
    7660        assertSame(layer2, command2.getLayer());
     
    9882        }
    9983
    100         NopCommand(OsmDataLayer layer) {
    101             super(layer);
     84        NopCommand(DataSet dataset) {
     85            super(dataset);
    10286        }
    10387
Note: See TracChangeset for help on using the changeset viewer.