Skip to content

Commit

Permalink
GEODE 3306: Unset system properties after parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenfoong committed Aug 3, 2017
1 parent 0a9c318 commit 64d46b0
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,16 @@ public void testCacheXmlParserWithSimplePool() {
*/
@Test
public void testCacheXmlParserWithSimplePoolXerces() {
System.setProperty("javax.xml.parsers.SAXParserFactory",
String prevParserFactory = System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");

testCacheXmlParserWithSimplePool();

if (prevParserFactory != null) {
System.setProperty("javax.xml.parsers.SAXParserFactory", prevParserFactory);
} else {
System.clearProperty("javax.xml.parsers.SAXParserFactory");
}
}

/**
Expand Down Expand Up @@ -161,9 +168,16 @@ public void testDTDFallbackWithNonEnglishLocal() {
*/
@Test
public void testDTDFallbackWithNonEnglishLocalXerces() {
System.setProperty("javax.xml.parsers.SAXParserFactory",
String prevParserFactory = System.setProperty("javax.xml.parsers.SAXParserFactory",
"org.apache.xerces.jaxp.SAXParserFactoryImpl");

testDTDFallbackWithNonEnglishLocal();

if (prevParserFactory != null) {
System.setProperty("javax.xml.parsers.SAXParserFactory", prevParserFactory);
} else {
System.clearProperty("javax.xml.parsers.SAXParserFactory");
}
}

/**
Expand Down

0 comments on commit 64d46b0

Please sign in to comment.