Changeset 9633 in josm
- Timestamp:
- 2016-01-26T00:02:31+01:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm/gui/preferences
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/gui/preferences/PreferencesTestUtils.java
r9624 r9633 19 19 */ 20 20 public static void testPreferenceSettingAddGui(PreferenceSettingFactory factory, Class<? extends DefaultTabPreferenceSetting> parentClass) { 21 testPreferenceSettingAddGui(factory, parentClass, 1); 22 } 23 24 /** 25 * Generic test for {@link PreferenceSetting#addGui(PreferenceTabbedPane)}. 26 * @param factory setting factory to test 27 * @param parentClass optional parent setting, can be {@code null} 28 * @param increment expected tab number increment 29 */ 30 public static void testPreferenceSettingAddGui(PreferenceSettingFactory factory, Class<? extends DefaultTabPreferenceSetting> parentClass, 31 int increment) { 21 32 PreferenceSetting setting = factory.createPreferenceSetting(); 22 33 PreferenceTabbedPane tabPane = new PreferenceTabbedPane(); … … 25 36 setting.addGui(tabPane); 26 37 if (parentClass != null) { 27 assertEquals(tabs + 1, tabPane.getSetting(parentClass).getTabPane().getTabCount());38 assertEquals(tabs + increment, tabPane.getSetting(parentClass).getTabPane().getTabCount()); 28 39 assertEquals(tabPane.getSetting(parentClass), ((SubPreferenceSetting) setting).getTabPreferenceSetting(tabPane)); 29 40 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/DrawingPreferenceTest.java
r9624 r9633 35 35 @Test 36 36 public void testAddGui() { 37 PreferencesTestUtils.testPreferenceSettingAddGui(new DrawingPreference.Factory(), DisplayPreference.class );37 PreferencesTestUtils.testPreferenceSettingAddGui(new DrawingPreference.Factory(), DisplayPreference.class, 2); 38 38 } 39 39 } -
trunk/test/unit/org/openstreetmap/josm/gui/preferences/display/LanguagePreferenceTest.java
r9624 r9633 35 35 @Test 36 36 public void testAddGui() { 37 PreferencesTestUtils.testPreferenceSettingAddGui(new LanguagePreference.Factory(), DisplayPreference.class);37 PreferencesTestUtils.testPreferenceSettingAddGui(new LanguagePreference.Factory(), null); 38 38 } 39 39 }
Note:
See TracChangeset
for help on using the changeset viewer.