Polish URL Cleanup
This commit is contained in:
@@ -76,10 +76,10 @@ public abstract class AbstractStaxHandlerTestCase {
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
AbstractStaxHandler handler = createStaxHandler(new StreamResult(stringWriter));
|
||||
xmlReader.setContentHandler(handler);
|
||||
xmlReader.setProperty("http://www.xml.org/sax/properties/lexical-handler", handler);
|
||||
xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
|
||||
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", false);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
|
||||
|
||||
xmlReader.parse(new InputSource(new StringReader(COMPLEX_XML)));
|
||||
|
||||
@@ -103,10 +103,10 @@ public abstract class AbstractStaxHandlerTestCase {
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
AbstractStaxHandler handler = createStaxHandler(new StreamResult(stringWriter));
|
||||
xmlReader.setContentHandler(handler);
|
||||
xmlReader.setProperty("http://www.xml.org/sax/properties/lexical-handler", handler);
|
||||
xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
|
||||
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
|
||||
xmlReader.parse(new InputSource(new StringReader(COMPLEX_XML)));
|
||||
|
||||
@@ -124,10 +124,10 @@ public abstract class AbstractStaxHandlerTestCase {
|
||||
Document result = documentBuilder.newDocument();
|
||||
AbstractStaxHandler handler = createStaxHandler(new DOMResult(result));
|
||||
xmlReader.setContentHandler(handler);
|
||||
xmlReader.setProperty("http://www.xml.org/sax/properties/lexical-handler", handler);
|
||||
xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
|
||||
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", false);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
|
||||
|
||||
xmlReader.parse(new InputSource(new StringReader(SIMPLE_XML)));
|
||||
|
||||
@@ -145,10 +145,10 @@ public abstract class AbstractStaxHandlerTestCase {
|
||||
Document result = documentBuilder.newDocument();
|
||||
AbstractStaxHandler handler = createStaxHandler(new DOMResult(result));
|
||||
xmlReader.setContentHandler(handler);
|
||||
xmlReader.setProperty("http://www.xml.org/sax/properties/lexical-handler", handler);
|
||||
xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
|
||||
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
|
||||
xmlReader.parse(new InputSource(new StringReader(SIMPLE_XML)));
|
||||
|
||||
|
||||
@@ -70,14 +70,14 @@ public abstract class AbstractStaxXMLReaderTestCase {
|
||||
|
||||
@Test
|
||||
public void contentHandlerNamespacesNoPrefixes() throws Exception {
|
||||
standardReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
standardReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", false);
|
||||
standardReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
standardReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
|
||||
standardReader.parse(new InputSource(createTestInputStream()));
|
||||
|
||||
AbstractStaxXMLReader staxXmlReader = createStaxXmlReader(createTestInputStream());
|
||||
ContentHandler contentHandler = mockContentHandler();
|
||||
staxXmlReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
staxXmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", false);
|
||||
staxXmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
staxXmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
|
||||
staxXmlReader.setContentHandler(contentHandler);
|
||||
staxXmlReader.parse(new InputSource());
|
||||
|
||||
@@ -86,14 +86,14 @@ public abstract class AbstractStaxXMLReaderTestCase {
|
||||
|
||||
@Test
|
||||
public void contentHandlerNamespacesPrefixes() throws Exception {
|
||||
standardReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
standardReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
standardReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
standardReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
standardReader.parse(new InputSource(createTestInputStream()));
|
||||
|
||||
AbstractStaxXMLReader staxXmlReader = createStaxXmlReader(createTestInputStream());
|
||||
ContentHandler contentHandler = mockContentHandler();
|
||||
staxXmlReader.setFeature("http://www.xml.org/sax/features/namespaces", true);
|
||||
staxXmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
staxXmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
|
||||
staxXmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
staxXmlReader.setContentHandler(contentHandler);
|
||||
staxXmlReader.parse(new InputSource());
|
||||
|
||||
@@ -102,14 +102,14 @@ public abstract class AbstractStaxXMLReaderTestCase {
|
||||
|
||||
@Test
|
||||
public void contentHandlerNoNamespacesPrefixes() throws Exception {
|
||||
standardReader.setFeature("http://www.xml.org/sax/features/namespaces", false);
|
||||
standardReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
standardReader.setFeature("http://xml.org/sax/features/namespaces", false);
|
||||
standardReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
standardReader.parse(new InputSource(createTestInputStream()));
|
||||
|
||||
AbstractStaxXMLReader staxXmlReader = createStaxXmlReader(createTestInputStream());
|
||||
ContentHandler contentHandler = mockContentHandler();
|
||||
staxXmlReader.setFeature("http://www.xml.org/sax/features/namespaces", false);
|
||||
staxXmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
staxXmlReader.setFeature("http://xml.org/sax/features/namespaces", false);
|
||||
staxXmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
staxXmlReader.setContentHandler(contentHandler);
|
||||
staxXmlReader.parse(new InputSource());
|
||||
|
||||
@@ -141,10 +141,10 @@ public abstract class AbstractStaxXMLReaderTestCase {
|
||||
|
||||
LexicalHandler expectedLexicalHandler = mockLexicalHandler();
|
||||
standardReader.setContentHandler(null);
|
||||
standardReader.setProperty("http://www.xml.org/sax/properties/lexical-handler", expectedLexicalHandler);
|
||||
standardReader.setProperty("http://xml.org/sax/properties/lexical-handler", expectedLexicalHandler);
|
||||
standardReader.parse(new InputSource(testLexicalHandlerXml.getInputStream()));
|
||||
inputFactory.setProperty("javax.xml.stream.isCoalescing", Boolean.FALSE);
|
||||
inputFactory.setProperty("https://java.sun.com/xml/stream/properties/report-cdata-event", Boolean.TRUE);
|
||||
inputFactory.setProperty("http://java.sun.com/xml/stream/properties/report-cdata-event", Boolean.TRUE);
|
||||
inputFactory.setProperty("javax.xml.stream.isReplacingEntityReferences", Boolean.FALSE);
|
||||
inputFactory.setProperty("javax.xml.stream.isSupportingExternalEntities", Boolean.FALSE);
|
||||
|
||||
@@ -152,7 +152,7 @@ public abstract class AbstractStaxXMLReaderTestCase {
|
||||
willAnswer(invocation -> invocation.getArguments()[0] = "element").
|
||||
given(actualLexicalHandler).startDTD(anyString(), anyString(), anyString());
|
||||
AbstractStaxXMLReader staxXmlReader = createStaxXmlReader(testLexicalHandlerXml.getInputStream());
|
||||
staxXmlReader.setProperty("http://www.xml.org/sax/properties/lexical-handler", actualLexicalHandler);
|
||||
staxXmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", actualLexicalHandler);
|
||||
staxXmlReader.parse(new InputSource());
|
||||
|
||||
// TODO: broken comparison since Mockito 2.2 upgrade
|
||||
|
||||
@@ -72,7 +72,7 @@ public class DomContentHandlerTests {
|
||||
|
||||
@Test
|
||||
public void contentHandlerDocumentNamespacePrefixes() throws Exception {
|
||||
xmlReader.setFeature("http://www.xml.org/sax/features/namespace-prefixes", true);
|
||||
xmlReader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
|
||||
handler = new DomContentHandler(result);
|
||||
expected = documentBuilder.parse(new InputSource(new StringReader(XML_1)));
|
||||
xmlReader.setContentHandler(handler);
|
||||
|
||||
Reference in New Issue
Block a user