diff --git a/src/test/groovy/io/openliberty/tools/gradle/BaseGenerateFeaturesTest.groovy b/src/test/groovy/io/openliberty/tools/gradle/BaseGenerateFeaturesTest.groovy index 38b512a7..b3f081ee 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/BaseGenerateFeaturesTest.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/BaseGenerateFeaturesTest.groovy @@ -215,12 +215,14 @@ class BaseGenerateFeaturesTest extends AbstractIntegrationTest { } // read configuration xml file - DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); - docBuilderFactory.setIgnoringComments(true); - docBuilderFactory.setCoalescing(true); - docBuilderFactory.setIgnoringElementContentWhitespace(true); - docBuilderFactory.setValidating(false); - DocumentBuilder documentBuilder = docBuilderFactory.newDocumentBuilder(); + DocumentBuilderFactory inputBuilderFactory = DocumentBuilderFactory.newInstance(); + inputBuilderFactory.setIgnoringComments(true); + inputBuilderFactory.setCoalescing(true); + inputBuilderFactory.setIgnoringElementContentWhitespace(true); + inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + DocumentBuilder documentBuilder = inputBuilderFactory.newDocumentBuilder(); Document doc = documentBuilder.parse(configurationFile); XPath xPath = XPathFactory.newInstance().newXPath(); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithConfigServerEnv.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithConfigServerEnv.groovy index aeba92bb..a5cb933f 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithConfigServerEnv.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithConfigServerEnv.groovy @@ -4,12 +4,6 @@ import org.junit.AfterClass import org.junit.BeforeClass import org.junit.Test -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - import org.junit.BeforeClass import org.junit.FixMethodOrder import org.junit.Test diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithNoProps.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithNoProps.groovy index 86ce3683..d5a351d6 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithNoProps.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithNoProps.groovy @@ -4,12 +4,6 @@ import org.junit.AfterClass import org.junit.BeforeClass import org.junit.Test -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - import java.io.BufferedReader; import java.io.FileReader; diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithOnlyProps.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithOnlyProps.groovy index 4e3475c6..4f35d0bf 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithOnlyProps.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithOnlyProps.groovy @@ -4,12 +4,6 @@ import org.junit.AfterClass import org.junit.BeforeClass import org.junit.Test -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - import java.io.BufferedReader; import java.io.FileReader; diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithProps.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithProps.groovy index cf3c42aa..e0cf9374 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithProps.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestAppendServerEnvWithProps.groovy @@ -4,12 +4,6 @@ import org.junit.AfterClass import org.junit.BeforeClass import org.junit.Test -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathFactory; - import java.io.BufferedReader; import java.io.FileReader; diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestCompileJSP.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestCompileJSP.groovy index cf4e2793..7ee90890 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestCompileJSP.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestCompileJSP.groovy @@ -66,6 +66,8 @@ public class TestCompileJSP extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true) inputBuilderFactory.setIgnoringElementContentWhitespace(true) inputBuilderFactory.setValidating(false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder() Document inputDoc=inputBuilder.parse(input) diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplication.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplication.groovy index a98e3d8f..57c68334 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplication.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplication.groovy @@ -67,6 +67,8 @@ public class TestLooseApplication extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationWithWarTask.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationWithWarTask.groovy index 2a284b74..57922559 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationWithWarTask.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestLooseApplicationWithWarTask.groovy @@ -66,6 +66,8 @@ public class TestLooseApplicationWithWarTask extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplication.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplication.groovy index 588d6787..e3fb593f 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplication.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplication.groovy @@ -78,6 +78,8 @@ public class TestLooseEarApplication extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplicationEarlibs.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplicationEarlibs.groovy index e58168ea..b20546e0 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplicationEarlibs.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestLooseEarApplicationEarlibs.groovy @@ -80,6 +80,8 @@ public class TestLooseEarApplicationEarlibs extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestLooseWarWithLooseJar.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestLooseWarWithLooseJar.groovy index cbb58ea5..c7e8eccb 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestLooseWarWithLooseJar.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestLooseWarWithLooseJar.groovy @@ -68,6 +68,8 @@ public class TestLooseWarWithLooseJar extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestMultiModuleLooseEar.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestMultiModuleLooseEar.groovy index 9938f953..6ec6196d 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestMultiModuleLooseEar.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestMultiModuleLooseEar.groovy @@ -77,6 +77,8 @@ public class TestMultiModuleLooseEar extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/TestPluginConfigFile.groovy b/src/test/groovy/io/openliberty/tools/gradle/TestPluginConfigFile.groovy index 1365c985..f6fb85dc 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/TestPluginConfigFile.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/TestPluginConfigFile.groovy @@ -68,6 +68,8 @@ public class TestPluginConfigFile extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input); diff --git a/src/test/groovy/io/openliberty/tools/gradle/VerifyLooseAppTestTimeoutSuccess.groovy b/src/test/groovy/io/openliberty/tools/gradle/VerifyLooseAppTestTimeoutSuccess.groovy index 26f5e8e9..90ed6bb9 100644 --- a/src/test/groovy/io/openliberty/tools/gradle/VerifyLooseAppTestTimeoutSuccess.groovy +++ b/src/test/groovy/io/openliberty/tools/gradle/VerifyLooseAppTestTimeoutSuccess.groovy @@ -66,6 +66,8 @@ public class VerifyLooseAppTestTimeoutSuccess extends AbstractIntegrationTest{ inputBuilderFactory.setCoalescing(true); inputBuilderFactory.setIgnoringElementContentWhitespace(true); inputBuilderFactory.setValidating(false); + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false) + inputBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) DocumentBuilder inputBuilder = inputBuilderFactory.newDocumentBuilder(); Document inputDoc=inputBuilder.parse(input);