Commit b5d0de4d authored by Florian Schäfer's avatar Florian Schäfer

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

git-svn-id: https://svn.openstreetmap.org/applications/editors/josm/plugins/wikipedia@34173 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4
parent a495b53f
......@@ -31,7 +31,7 @@ public class SophoxServerPreference implements SubPreferenceSetting {
*/
public static class Factory implements PreferenceSettingFactory {
@Override
public PreferenceSetting createPreferenceSetting() {
public SophoxServerPreference createPreferenceSetting() {
return new SophoxServerPreference();
}
}
......
// License: GPL. For details, see LICENSE file.
package org.wikipedia.gui;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.junit.Rule;
import org.junit.Test;
import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
import org.openstreetmap.josm.gui.preferences.server.ServerAccessPreference;
import org.openstreetmap.josm.testutils.JOSMTestRules;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Unit tests of {@link SophoxServerPreference} class.
*/
......@@ -36,6 +36,15 @@ public class SophoxServerPreferenceTest {
*/
@Test
public void testAddGui() {
PreferencesTestUtils.doTestPreferenceSettingAddGui(new SophoxServerPreference.Factory(), ServerAccessPreference.class);
final SophoxServerPreference setting = new SophoxServerPreference.Factory().createPreferenceSetting();
final PreferenceTabbedPane tabPane = new PreferenceTabbedPane();
tabPane.buildGui();
int tabs = tabPane.getSetting(ServerAccessPreference.class).getTabPane().getTabCount();
setting.addGui(tabPane);
assertEquals(tabs + 1, tabPane.getSetting(ServerAccessPreference.class).getTabPane().getTabCount());
assertEquals(tabPane.getSetting(ServerAccessPreference.class), setting.getTabPreferenceSetting(tabPane));
setting.ok();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment