Ignore:
Timestamp:
2018-04-28T20:31:37+02:00 (6 years ago)
Author:
floscher
Message:

JOSM/wikipedia: Remove dependency on PreferencesTestUtils (not in josm-unittest.jar)

Location:
applications/editors/josm/plugins/wikipedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/wikipedia/src/org/wikipedia/gui/SophoxServerPreference.java

    r33808 r34173  
    3232    public static class Factory implements PreferenceSettingFactory {
    3333        @Override
    34         public PreferenceSetting createPreferenceSetting() {
     34        public SophoxServerPreference createPreferenceSetting() {
    3535            return new SophoxServerPreference();
    3636        }
  • applications/editors/josm/plugins/wikipedia/test/unit/org/wikipedia/gui/SophoxServerPreferenceTest.java

    r33808 r34173  
    22package org.wikipedia.gui;
    33
     4import static org.junit.Assert.assertEquals;
    45import static org.junit.Assert.assertNotNull;
    56
     7import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    68import org.junit.Rule;
    79import org.junit.Test;
    8 import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     10import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
    911import org.openstreetmap.josm.gui.preferences.server.ServerAccessPreference;
    1012import org.openstreetmap.josm.testutils.JOSMTestRules;
    11 
    12 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
    1313
    1414/**
     
    3737    @Test
    3838    public void testAddGui() {
    39         PreferencesTestUtils.doTestPreferenceSettingAddGui(new SophoxServerPreference.Factory(), ServerAccessPreference.class);
     39        final SophoxServerPreference setting = new SophoxServerPreference.Factory().createPreferenceSetting();
     40        final PreferenceTabbedPane tabPane = new PreferenceTabbedPane();
     41        tabPane.buildGui();
     42        int tabs = tabPane.getSetting(ServerAccessPreference.class).getTabPane().getTabCount();
     43        setting.addGui(tabPane);
     44
     45        assertEquals(tabs + 1, tabPane.getSetting(ServerAccessPreference.class).getTabPane().getTabCount());
     46        assertEquals(tabPane.getSetting(ServerAccessPreference.class), setting.getTabPreferenceSetting(tabPane));
     47
     48        setting.ok();
    4049    }
    4150}
Note: See TracChangeset for help on using the changeset viewer.