Changeset 9624 in josm for trunk


Ignore:
Timestamp:
2016-01-25T02:46:36+01:00 (9 years ago)
Author:
Don-vip
Message:

update/fix preferences unit tests, based on work from Mapillary plugin unit tests

Location:
trunk
Files:
1 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r9242 r9624  
    470470
    471471        for (PreferenceSettingFactory factory : factories) {
    472             PreferenceSetting setting = factory.createPreferenceSetting();
    473             if (setting != null) {
    474                 settings.add(setting);
     472            if (factory != null) {
     473                PreferenceSetting setting = factory.createPreferenceSetting();
     474                if (setting != null) {
     475                    settings.add(setting);
     476                }
    475477            }
    476478        }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new AdvancedPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new AdvancedPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/audio/AudioPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new AudioPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new AudioPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/ColorPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ColorPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ColorPreference.Factory(), DisplayPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DisplayPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new DisplayPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new DisplayPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new DrawingPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new DrawingPreference.Factory(), DisplayPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LafPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new LafPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new LafPreference.Factory(), DisplayPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new LanguagePreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new LanguagePreference.Factory(), DisplayPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ImageryPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ImageryPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/BackupPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new BackupPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new BackupPreference.Factory(), MapPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new MapPaintPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new MapPaintPreference.Factory(), MapPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new MapPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new MapPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new TaggingPresetPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new TaggingPresetPreference.Factory(), MapPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferenceTest.java

    r9621 r9624  
    1414import org.openstreetmap.josm.JOSMFixture;
    1515import org.openstreetmap.josm.TestUtils;
    16 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     16import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1717import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1818import org.openstreetmap.josm.plugins.PluginDownloadTask;
     
    8989    @Test
    9090    public void testAddGui() {
    91         new PluginPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     91        PreferencesTestUtils.testPreferenceSettingAddGui(new PluginPreference.Factory(), null);
    9292    }
    9393}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
     10import org.openstreetmap.josm.gui.preferences.map.MapPreference;
    1011
    1112/**
     
    3536    @Test
    3637    public void testAddGui() {
    37         new ProjectionPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     38        PreferencesTestUtils.testPreferenceSettingAddGui(new ProjectionPreference.Factory(), MapPreference.class);
    3839    }
    3940}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/remotecontrol/RemoteControlPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new RemoteControlPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new RemoteControlPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new AuthenticationPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new AuthenticationPreference.Factory(), ServerAccessPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/OverpassServerPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new OverpassServerPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new OverpassServerPreference.Factory(), ServerAccessPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ProxyPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ProxyPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ProxyPreference.Factory(), ServerAccessPreference.class);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/server/ServerAccessPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ServerAccessPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ServerAccessPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/shortcut/ShortcutPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ShortcutPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ShortcutPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ValidatorPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ValidatorPreference.Factory(), null);
    3838    }
    3939}
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreferenceTest.java

    r9622 r9624  
    77import org.junit.Test;
    88import org.openstreetmap.josm.JOSMFixture;
    9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
     9import org.openstreetmap.josm.gui.preferences.PreferencesTestUtils;
    1010
    1111/**
     
    3535    @Test
    3636    public void testAddGui() {
    37         new ValidatorTestsPreference.Factory().createPreferenceSetting().addGui(new PreferenceTabbedPane());
     37        PreferencesTestUtils.testPreferenceSettingAddGui(new ValidatorTestsPreference.Factory(), ValidatorPreference.class);
    3838    }
    3939}
Note: See TracChangeset for help on using the changeset viewer.