Ignore:
Timestamp:
2015-10-12T22:58:25+02:00 (9 years ago)
Author:
Don-vip
Message:

major code cleanup/refactoring of tagging presets: slay the monster TaggingPresetItems (60 Kb, 1600 lines) and extract all its internal classes to a new package gui.tagging.presets.items

Location:
trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetReaderTest.java

    r8862 r8863  
    11// License: GPL. For details, see LICENSE file.
    2 package org.openstreetmap.josm.gui.tagging;
     2package org.openstreetmap.josm.gui.tagging.presets;
    33
    44import static org.CustomMatchers.hasSize;
     
    1515import org.openstreetmap.josm.JOSMFixture;
    1616import org.openstreetmap.josm.TestUtils;
     17import org.openstreetmap.josm.gui.tagging.presets.items.Check;
     18import org.openstreetmap.josm.gui.tagging.presets.items.Key;
    1719import org.openstreetmap.josm.tools.Utils;
    1820import org.xml.sax.SAXException;
     
    3335    /**
    3436     * #8954 - last checkbox in the preset is not added
     37     * @throws SAXException if any XML error occurs
     38     * @throws IOException if any I/O error occurs
    3539     */
    3640    @Test
     
    4246        Assert.assertEquals("Number of entries", 1, preset.data.size());
    4347        final TaggingPresetItem item = preset.data.get(0);
    44         Assert.assertTrue("Entry is not checkbox", item instanceof TaggingPresetItems.Check);
     48        Assert.assertTrue("Entry is not checkbox", item instanceof Check);
    4549    }
    4650
     51    /**
     52     * Test nested chunks
     53     * @throws SAXException if any XML error occurs
     54     * @throws IOException if any I/O error occurs
     55     */
    4756    @Test
    48     public void testNestedChunks() throws Exception {
     57    public void testNestedChunks() throws SAXException, IOException {
    4958        final Collection<TaggingPreset> presets = TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_chunk.xml", true);
    5059        assertThat(presets, hasSize(1));
     
    5362            @Override
    5463            public String apply(TaggingPresetItem x) {
    55                 return ((TaggingPresetItems.Key) x).key;
     64                return ((Key) x).key;
    5665            }
    5766        });
     
    6271     * Validate internal presets
    6372     * See #9027
     73     * @throws SAXException if any XML error occurs
     74     * @throws IOException if any I/O error occurs
    6475     */
    6576    @Test
Note: See TracChangeset for help on using the changeset viewer.