Changeset 16560 in josm for trunk/test/unit/org


Ignore:
Timestamp:
2020-06-07T17:19:38+02:00 (4 years ago)
Author:
simon04
Message:

fix #19286 - External entities are resolved when parsing tagging presets (patch by hiddewie, modified)

Location:
trunk/test/unit/org/openstreetmap/josm
Files:
1 added
1 edited

Legend:

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

    r14138 r16560  
    66import static org.junit.Assert.assertThat;
    77import static org.junit.Assert.assertTrue;
     8import static org.junit.Assert.fail;
    89
    910import java.io.IOException;
     
    6768
    6869    /**
     70     * Test external entity resolving.
     71     * See #19286
     72     */
     73    @Test
     74    public void testExternalEntityResolving() throws IOException {
     75        try {
     76            TaggingPresetReader.readAll(TestUtils.getTestDataRoot() + "preset_external_entity.xml", true);
     77            fail("Reading a file with external entities should throw an SAXParseException!");
     78        } catch (SAXException e) {
     79            String expected = "DOCTYPE is disallowed when the feature \"http://apache.org/xml/features/disallow-doctype-decl\" set to true.";
     80            assertEquals(expected, e.getMessage());
     81        }
     82    }
     83
     84    /**
    6985     * Validate internal presets
    7086     * See #9027
Note: See TracChangeset for help on using the changeset viewer.