diff options
author | PJ Fanning <fanningpj@apache.org> | 2024-06-17 21:37:36 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2024-06-17 21:37:36 +0000 |
commit | 2a47c185c6b23df472b50130d0c3111dfc0d0ba9 (patch) | |
tree | 898fbefdd4c62055326ed7665f9f6a32af8a8e17 /poi | |
parent | ebc4c37e7891775438d7197b16c10e8f56bcb0f4 (diff) | |
download | poi-2a47c185c6b23df472b50130d0c3111dfc0d0ba9.tar.gz poi-2a47c185c6b23df472b50130d0c3111dfc0d0ba9.zip |
issue with Java 22 returning string values insteadof booleans
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918397 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi')
-rw-r--r-- | poi/src/test/java/org/apache/poi/util/TestXMLHelper.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java b/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java index 3dec9056e5..f291aea270 100644 --- a/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java +++ b/poi/src/test/java/org/apache/poi/util/TestXMLHelper.java @@ -36,6 +36,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLOutputFactory; +import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; import org.xml.sax.InputSource; import org.xml.sax.SAXNotRecognizedException; @@ -136,12 +137,12 @@ class TestXMLHelper { @Test void testNewXMLInputFactory() { XMLInputFactory factory = XMLHelper.newXMLInputFactory(); - if (!System.getProperty("java.version").startsWith("22")) { - assertEquals(Boolean.TRUE, factory.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)); - assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_VALIDATING)); - assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.SUPPORT_DTD)); - assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)); - } + Assumptions.assumeFalse(System.getProperty("java.version").startsWith("22"), + "test ignored for Java 22"); + assertEquals(Boolean.TRUE, factory.getProperty(XMLInputFactory.IS_NAMESPACE_AWARE)); + assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_VALIDATING)); + assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.SUPPORT_DTD)); + assertEquals(Boolean.FALSE, factory.getProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)); } /** @@ -150,9 +151,9 @@ class TestXMLHelper { @Test void testNewXMLOutputFactory() { XMLOutputFactory factory = XMLHelper.newXMLOutputFactory(); - if (!System.getProperty("java.version").startsWith("22")) { - assertEquals(Boolean.TRUE, factory.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES)); - } + Assumptions.assumeFalse(System.getProperty("java.version").startsWith("22"), + "test ignored for Java 22"); + assertEquals(Boolean.TRUE, factory.getProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES)); } /** |