Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xml file processing #877

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ jobs:
- name: Checkout ci.common
uses: actions/checkout@v3
with:
repository: OpenLiberty/ci.common
repository: cherylking/ci.common
ref: fixXmlFileProcessing
path: ci.common
- name: Checkout ci.ant
uses: actions/checkout@v3
Expand Down Expand Up @@ -124,7 +125,7 @@ jobs:
- name: Clone ci.ant, ci.common, ci.gradle repos to C drive
run: |
cp -r D:/a/ci.gradle/ci.gradle C:/ci.gradle
git clone https://github.com/OpenLiberty/ci.common.git C:/ci.common
git clone https://github.com/cherylking/ci.common.git --branch fixXmlFileProcessing --single-branch C:/ci.common
git clone https://github.com/OpenLiberty/ci.ant.git C:/ci.ant
# Cache mvn/gradle packages
- name: Cache Maven packages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading