Changeset 9973 in josm for trunk/test


Ignore:
Timestamp:
2016-03-12T23:58:33+01:00 (9 years ago)
Author:
Don-vip
Message:

sonar - JUnit4 tests should use @Test annotation

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJobTest.java

    r8857 r9973  
    7272    @Test
    7373    public void testStatusCodes() throws Exception {
    74         testStatusCode(200);
     74        doTestStatusCode(200);
    7575        // can't test for 3xx, as httpstat.us redirects finally to 200 page
    76         testStatusCode(401);
    77         testStatusCode(402);
    78         testStatusCode(403);
    79         testStatusCode(404);
    80         testStatusCode(405);
    81         testStatusCode(500);
    82         testStatusCode(501);
    83         testStatusCode(502);
     76        doTestStatusCode(401);
     77        doTestStatusCode(402);
     78        doTestStatusCode(403);
     79        doTestStatusCode(404);
     80        doTestStatusCode(405);
     81        doTestStatusCode(500);
     82        doTestStatusCode(501);
     83        doTestStatusCode(502);
    8484    }
    8585
    8686    @Test
    87     public void testUnkownHost() throws Exception {
     87    public void testUnknownHost() throws Exception {
    8888        TestCachedTileLoaderJob job = new TestCachedTileLoaderJob("http://unkownhost.unkownhost/unkown");
    8989        Listener listener = new Listener();
     
    9797    }
    9898
    99     public void testStatusCode(int responseCode) throws Exception {
     99    private void doTestStatusCode(int responseCode) throws Exception {
    100100        TestCachedTileLoaderJob job = getStatusLoaderJob(responseCode);
    101101        Listener listener = new Listener();
  • trunk/test/unit/org/openstreetmap/josm/data/imagery/WMTSTileSourceTest.java

    r9902 r9973  
    1010
    1111import org.junit.BeforeClass;
     12import org.junit.Ignore;
    1213import org.junit.Test;
    1314import org.openstreetmap.gui.jmapviewer.tilesources.TemplatedTMSTileSource;
     
    8485        assertEquals("TileXMax", 4, testSource.getTileXMax(2));
    8586        assertEquals("TileYMax", 4, testSource.getTileYMax(2));
    86 
    8787    }
    8888
     
    106106    }
    107107
    108     // XXX - disable this test, needs further working
    109     // @Test
     108    @Test
     109    @Ignore("disable this test, needs further working") // XXX
    110110    public void testWALLONIENoMatrixDimension() throws MalformedURLException, IOException {
    111111        Main.setProjection(Projections.getProjectionByCode("EPSG:31370"));
     
    224224    }
    225225
    226 
    227     // XXX: disabled as this needs user action
    228     //@Test
     226    @Test
     227    @Ignore("disabled as this needs user action") // XXX
    229228    public void testTwoTileSetsForOneProjection() throws Exception {
    230229        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
     
    236235    }
    237236
    238     // XXX: disabled as this needs user action
    239     // @Test
     237    @Test
     238    @Ignore("disabled as this needs user action") // XXX
    240239    public void testManyLayersScrollbars() throws Exception {
    241240        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
     
    246245
    247246    @Test
    248     public void testPraserForDuplicateTags() throws Exception {
     247    public void testParserForDuplicateTags() throws Exception {
    249248        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
    250249        WMTSTileSource testSource = new WMTSTileSource(testDuplicateTags);
     
    258257
    259258    @Test
    260     public void testPraserForMissingStyleIdentifier() throws Exception {
     259    public void testParserForMissingStyleIdentifier() throws Exception {
    261260        Main.setProjection(Projections.getProjectionByCode("EPSG:3857"));
    262261        WMTSTileSource testSource = new WMTSTileSource(testMissingStyleIdentifer);
     
    268267        assertEquals("Latitude", expected.lat(), ll.lat(), 1e-05);
    269268        assertEquals("Longitude", expected.lon(), ll.lon(), 1e-05);
    270 
    271269    }
    272270
  • trunk/test/unit/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModelTest.java

    r9547 r9973  
    2424public class PropertiesMergeModelTest {
    2525
    26     public abstract static class TestObserver implements Observer {
     26    private abstract static class TestObserver implements Observer {
    2727        public int numInvocations;
    2828
     29        @Override
    2930        public void update(Observable o, Object arg) {
    3031            numInvocations++;
    31             test();
     32            doTest();
    3233        }
    3334
    34         public abstract void test();
     35        public abstract void doTest();
    3536
    3637        public void assertNumInvocations(int count) {
     
    100101        assertTrue(model.hasCoordConflict());
    101102
    102 
    103103        n1.cloneFrom(new Node(1));
    104104        n2.setCoor(new LatLon(2, 2));
     
    117117                observerTest = new TestObserver() {
    118118                    @Override
    119                     public void test() {
     119                    public void doTest() {
    120120                        assertTrue(model.isCoordMergeDecision(MergeDecisionType.KEEP_MINE));
    121121                    }
     
    132132                observerTest = new TestObserver() {
    133133                    @Override
    134                     public void test() {
     134                    public void doTest() {
    135135                        assertTrue(model.isCoordMergeDecision(MergeDecisionType.KEEP_THEIR));
    136136                    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java

    r9669 r9973  
    1818     * @param parentClass optional parent setting, can be {@code null}
    1919     */
    20     public static void testPreferenceSettingAddGui(PreferenceSettingFactory factory, Class<? extends DefaultTabPreferenceSetting> parentClass) {
    21         testPreferenceSettingAddGui(factory, parentClass, 1);
     20    public static void doTestPreferenceSettingAddGui(
     21            PreferenceSettingFactory factory, Class<? extends DefaultTabPreferenceSetting> parentClass) {
     22        doTestPreferenceSettingAddGui(factory, parentClass, 1);
    2223    }
    2324
     
    2829     * @param increment expected tab number increment
    2930     */
    30     public static void testPreferenceSettingAddGui(PreferenceSettingFactory factory, Class<? extends DefaultTabPreferenceSetting> parentClass,
    31             int increment) {
     31    public static void doTestPreferenceSettingAddGui(
     32            PreferenceSettingFactory factory, Class<? extends DefaultTabPreferenceSetting> parentClass, int increment) {
    3233        PreferenceSetting setting = factory.createPreferenceSetting();
    3334        PreferenceTabbedPane tabPane = new PreferenceTabbedPane();
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new AdvancedPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new AdvancedPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new AudioPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new AudioPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ColorPreference.Factory(), DisplayPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ColorPreference.Factory(), DisplayPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new DisplayPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new DisplayPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new DrawingPreference.Factory(), DisplayPreference.class, 2);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new DrawingPreference.Factory(), DisplayPreference.class, 2);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new LafPreference.Factory(), DisplayPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new LafPreference.Factory(), DisplayPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new LanguagePreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new LanguagePreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ImageryPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ImageryPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new BackupPreference.Factory(), MapPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new BackupPreference.Factory(), MapPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new MapPaintPreference.Factory(), MapPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new MapPaintPreference.Factory(), MapPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new MapPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new MapPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new TaggingPresetPreference.Factory(), MapPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new TaggingPresetPreference.Factory(), MapPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java

    r9669 r9973  
    8989    @Test
    9090    public void testAddGui() {
    91         PreferencesTestUtils.testPreferenceSettingAddGui(new PluginPreference.Factory(), null);
     91        PreferencesTestUtils.doTestPreferenceSettingAddGui(new PluginPreference.Factory(), null);
    9292    }
    9393}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java

    r9669 r9973  
    3636    @Test
    3737    public void testAddGui() {
    38         PreferencesTestUtils.testPreferenceSettingAddGui(new ProjectionPreference.Factory(), MapPreference.class);
     38        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProjectionPreference.Factory(), MapPreference.class);
    3939    }
    4040}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new RemoteControlPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new RemoteControlPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new AuthenticationPreference.Factory(), ServerAccessPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new AuthenticationPreference.Factory(), ServerAccessPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new OverpassServerPreference.Factory(), ServerAccessPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new OverpassServerPreference.Factory(), ServerAccessPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ProxyPreference.Factory(), ServerAccessPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ProxyPreference.Factory(), ServerAccessPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ShortcutPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ShortcutPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ValidatorPreference.Factory(), null);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ValidatorPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java

    r9669 r9973  
    3535    @Test
    3636    public void testAddGui() {
    37         PreferencesTestUtils.testPreferenceSettingAddGui(new ValidatorTestsPreference.Factory(), ValidatorPreference.class);
     37        PreferencesTestUtils.doTestPreferenceSettingAddGui(new ValidatorTestsPreference.Factory(), ValidatorPreference.class);
    3838    }
    3939}
Note: See TracChangeset for help on using the changeset viewer.