Changeset 10093 in josm for trunk/test


Ignore:
Timestamp:
2016-04-01T15:40:44+02:00 (8 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/plugins/PluginHandlerTest.java

    r9870 r10093  
    22package org.openstreetmap.josm.plugins;
    33
     4import static org.junit.Assert.assertEquals;
     5import static org.junit.Assert.assertFalse;
    46import static org.junit.Assert.assertNotNull;
    57import static org.junit.Assert.assertTrue;
    68
     9import java.util.ArrayList;
    710import java.util.Arrays;
    811import java.util.List;
     
    1114import org.junit.Test;
    1215import org.openstreetmap.josm.JOSMFixture;
     16import org.openstreetmap.josm.Main;
    1317import org.openstreetmap.josm.plugins.PluginHandler.DeprecatedPlugin;
    1418import org.openstreetmap.josm.tools.Utils;
     
    5862        }
    5963    }
     64
     65    /**
     66     * Unit test of {@link PluginHandler#filterDeprecatedPlugins}.
     67     */
     68    @Test
     69    public void testFilterDeprecatedPlugins() {
     70        List<String> plugins = new ArrayList<>(Arrays.asList("foo", "bar", "imagery"));
     71        PluginHandler.filterDeprecatedPlugins(Main.parent, plugins);
     72        assertEquals(2, plugins.size());
     73        assertFalse(plugins.contains("imagery"));
     74    }
     75
     76    /**
     77     * Unit test of {@link PluginHandler#filterUnmaintainedPlugins}.
     78     */
     79    @Test
     80    public void testFilterUnmaintainedPlugins() {
     81        List<String> plugins = new ArrayList<>(Arrays.asList("foo", "bar", "gpsbabelgui"));
     82        PluginHandler.filterUnmaintainedPlugins(Main.parent, plugins);
     83        assertEquals(2, plugins.size());
     84        assertFalse(plugins.contains("gpsbabelgui"));
     85    }
    6086}
Note: See TracChangeset for help on using the changeset viewer.