diff options
-rw-r--r-- | expectations/icebox.txt | 32 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/DeclarationTest.java (renamed from luni/src/test/java/tests/xml/DeclarationTest.java) | 2 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/DomTest.java (renamed from luni/src/test/java/tests/xml/DomTest.java) | 2 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/NodeTest.java (renamed from luni/src/test/java/tests/xml/NodeTest.java) | 2 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/NormalizeTest.java (renamed from luni/src/test/java/tests/xml/NormalizeTest.java) | 2 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/SaxTest.java (renamed from luni/src/test/java/tests/xml/SaxTest.java) | 2 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/SimpleBuilderTest.java (renamed from luni/src/test/java/tests/xml/SimpleBuilderTest.java) | 2 | ||||
-rw-r--r-- | luni/src/test/java/libcore/xml/SimpleParserTest.java (renamed from luni/src/test/java/tests/xml/SimpleParserTest.java) | 114 |
8 files changed, 71 insertions, 87 deletions
diff --git a/expectations/icebox.txt b/expectations/icebox.txt index 4619725..4d664a6 100644 --- a/expectations/icebox.txt +++ b/expectations/icebox.txt @@ -5,61 +5,61 @@ { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DomTest#testEntityDeclarations", + name: "libcore.xml.DomTest#testEntityDeclarations", substring: "This implementation does not parse entity declarations" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DomTest#testGetWholeTextWithEntityReference", + name: "libcore.xml.DomTest#testGetWholeTextWithEntityReference", substring: "This implementation doesn't resolve entity references in getWholeText" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", - name: "tests.xml.DomTest#testExpandingEntityReferencesOff", + name: "libcore.xml.DomTest#testExpandingEntityReferencesOff", bug: 3268630, substring: "This implementation doesn't include children in entity references" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", - name: "tests.xml.DomTest#testExpandingEntityReferencesOn", + name: "libcore.xml.DomTest#testExpandingEntityReferencesOn", bug: 3268630, substring: "This implementation doesn't expand entity references" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DomTest#testIsElementContentWhitespaceWithDeclaration", + name: "libcore.xml.DomTest#testIsElementContentWhitespaceWithDeclaration", substring: "This implementation does not recognize element content whitespace" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DomTest#testNotations", + name: "libcore.xml.DomTest#testNotations", substring: "This implementation does not parse notations" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DeclarationTest#testGetXmlEncoding", + name: "libcore.xml.DeclarationTest#testGetXmlEncoding", substring: "This implementation doesn't parse the encoding from the XML declaration expected:<ISO-8859-1> but was:<null>" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DeclarationTest#testGetXmlStandalone", + name: "libcore.xml.DeclarationTest#testGetXmlStandalone", substring: "This implementation doesn't parse standalone from the XML declaration expected:<true> but was:<false>" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DeclarationTest#testGetXmlVersion", + name: "libcore.xml.DeclarationTest#testGetXmlVersion", substring: "This implementation doesn't parse the version from the XML declaration" }, { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.NormalizeTest#testSchemaTypeDtd", + name: "libcore.xml.NormalizeTest#testSchemaTypeDtd", substring: "This implementation's setParameter() supports an unexpected value: schema-type=http://www.w3.org/TR/REC-xml" }, { @@ -71,7 +71,7 @@ { description: "Dalvik doesn't support XML Schemas, DTDs or validation", bug: 3268630, - name: "tests.xml.DeclarationTest.testGetXmlVersion", + name: "libcore.xml.DeclarationTest.testGetXmlVersion", substring: "This implementation doesn't parse the version from the XML declaration" }, { @@ -108,31 +108,31 @@ { description: "low-impact XML bugs:", result: EXEC_FAILED, - name: "tests.xml.DomTest#testAttributeNamedIdIsNotAnIdByDefault", + name: "libcore.xml.DomTest#testAttributeNamedIdIsNotAnIdByDefault", substring: "This implementation incorrectly interprets the \"id\" attribute as an identifier by default" }, { description: "low-impact XML bugs:", result: EXEC_FAILED, - name: "tests.xml.DomTest#testDocumentAddChild", + name: "libcore.xml.DomTest#testDocumentAddChild", substring: "Document nodes shouldn't accept child nodes" }, { description: "low-impact XML bugs:", result: EXEC_FAILED, - name: "tests.xml.DomTest#testElementTraversalFeature", + name: "libcore.xml.DomTest#testElementTraversalFeature", substring: "This implementation is expected to support ElementTraversal v. 1.0 but does not." }, { description: "low-impact XML bugs:", result: EXEC_FAILED, - name: "tests.xml.DomTest#testLoadSaveFeature", + name: "libcore.xml.DomTest#testLoadSaveFeature", substring: "This implementation is expected to support LS v. 3.0 but does not." }, { description: "low-impact XML bugs:", result: EXEC_FAILED, - name: "tests.xml.SaxTest#testYesPrefixesYesNamespaces", + name: "libcore.xml.SaxTest#testYesPrefixesYesNamespaces", substring: "The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled." }, { diff --git a/luni/src/test/java/tests/xml/DeclarationTest.java b/luni/src/test/java/libcore/xml/DeclarationTest.java index 9fc42fe..24cb32c 100644 --- a/luni/src/test/java/tests/xml/DeclarationTest.java +++ b/luni/src/test/java/libcore/xml/DeclarationTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import dalvik.annotation.KnownFailure; import junit.framework.TestCase; diff --git a/luni/src/test/java/tests/xml/DomTest.java b/luni/src/test/java/libcore/xml/DomTest.java index 3761138..4b97c06 100644 --- a/luni/src/test/java/tests/xml/DomTest.java +++ b/luni/src/test/java/libcore/xml/DomTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import dalvik.annotation.KnownFailure; import java.io.File; diff --git a/luni/src/test/java/tests/xml/NodeTest.java b/luni/src/test/java/libcore/xml/NodeTest.java index a2c86a9..7e38673 100644 --- a/luni/src/test/java/tests/xml/NodeTest.java +++ b/luni/src/test/java/libcore/xml/NodeTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import junit.framework.TestCase; import org.w3c.dom.Document; diff --git a/luni/src/test/java/tests/xml/NormalizeTest.java b/luni/src/test/java/libcore/xml/NormalizeTest.java index 5d2bb0be..5e539f7 100644 --- a/luni/src/test/java/tests/xml/NormalizeTest.java +++ b/luni/src/test/java/libcore/xml/NormalizeTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import dalvik.annotation.KnownFailure; import junit.framework.TestCase; diff --git a/luni/src/test/java/tests/xml/SaxTest.java b/luni/src/test/java/libcore/xml/SaxTest.java index dc59b2d..5416cdd 100644 --- a/luni/src/test/java/tests/xml/SaxTest.java +++ b/luni/src/test/java/libcore/xml/SaxTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import dalvik.annotation.KnownFailure; import junit.framework.TestCase; diff --git a/luni/src/test/java/tests/xml/SimpleBuilderTest.java b/luni/src/test/java/libcore/xml/SimpleBuilderTest.java index 4dbe73e..db4d1af 100644 --- a/luni/src/test/java/tests/xml/SimpleBuilderTest.java +++ b/luni/src/test/java/libcore/xml/SimpleBuilderTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; diff --git a/luni/src/test/java/tests/xml/SimpleParserTest.java b/luni/src/test/java/libcore/xml/SimpleParserTest.java index f3f0dde..fa49640 100644 --- a/luni/src/test/java/tests/xml/SimpleParserTest.java +++ b/luni/src/test/java/libcore/xml/SimpleParserTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package tests.xml; +package libcore.xml; import junit.framework.TestCase; @@ -34,7 +34,7 @@ import java.util.Map; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; -public class SimpleParserTest extends TestCase implements ContentHandler { +public class SimpleParserTest extends TestCase { private SAXParser parser; @@ -58,7 +58,7 @@ public class SimpleParserTest extends TestCase implements ContentHandler { factory.setNamespaceAware(true); parser = factory.newSAXParser(); - parser.getXMLReader().setContentHandler(this); + parser.getXMLReader().setContentHandler(contentHandler); instructions = new StringBuffer(); namespaces1 = new HashMap<String, String>(); @@ -83,90 +83,74 @@ public class SimpleParserTest extends TestCase implements ContentHandler { text = null; } - public void characters(char[] ch, int start, int length) { - - String s = new String(ch, start, length).trim(); - if (s.length() != 0) { - if (text.length() != 0) { - text.append(","); + private final ContentHandler contentHandler = new ContentHandler() { + public void characters(char[] ch, int start, int length) { + String s = new String(ch, start, length).trim(); + if (!s.isEmpty()) { + if (text.length() != 0) { + text.append(","); + } + text.append(s); } - - text.append(s); } - } - public void endDocument() { - } - - public void endElement(String uri, String localName, String qName) { - } - - public void endPrefixMapping(String prefix) { - } - - public void ignorableWhitespace(char[] ch, int start, int length) { - } - - public void processingInstruction(String target, String data) { - String s = target + ":" + data; - - if (instructions.length() != 0) { - instructions.append(","); + public void processingInstruction(String target, String data) { + String s = target + ":" + data; + if (instructions.length() != 0) { + instructions.append(","); + } + instructions.append(s); } - instructions.append(s); - } - public void setDocumentLocator(Locator locator) { - } + public void startElement(String uri, String localName, String qName, Attributes atts) { - public void skippedEntity(String name) { - } - - public void startDocument() { - } - - public void startElement(String uri, String localName, String qName, - Attributes atts) { + if (elements1.length() != 0) { + elements1.append(","); + } - if (elements1.length() != 0) { - elements1.append(","); - } + elements1.append(localName); - elements1.append(localName); + if (!"".equals(uri)) { + namespaces1.put(localName, uri); + } - if (!"".equals(uri)) { - namespaces1.put(localName, uri); - } + for (int i = 0; i < atts.getLength(); i++) { + attributes1.put(atts.getLocalName(i), atts.getValue(i)); + } - for (int i = 0; i < atts.getLength(); i++) { - attributes1.put(atts.getLocalName(i), atts.getValue(i)); - } + if (elements2.length() != 0) { + elements2.append(","); + } - if (elements2.length() != 0) { - elements2.append(","); - } + elements2.append(qName); - elements2.append(qName); + if (!"".equals(uri)) { + namespaces2.put(qName, uri); + } - if (!"".equals(uri)) { - namespaces2.put(qName, uri); + for (int i = 0; i < atts.getLength(); i++) { + attributes2.put(atts.getQName(i), atts.getValue(i)); + } } - for (int i = 0; i < atts.getLength(); i++) { - attributes2.put(atts.getQName(i), atts.getValue(i)); - } - } + public void endDocument() {} + public void endElement(String uri, String localName, String qName) {} + public void endPrefixMapping(String prefix) {} + public void ignorableWhitespace(char[] ch, int start, int length) {} + public void setDocumentLocator(Locator locator) {} + public void skippedEntity(String name) {} + public void startDocument() {} + public void startPrefixMapping(String prefix, String uri) {} + }; - public void startPrefixMapping(String prefix, String uri) { - } public void testWorkingFile1() throws Exception { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(false); factory.setNamespaceAware(true); SAXParser parser = factory.newSAXParser(); - parser.getXMLReader().setContentHandler(this); + parser.getXMLReader().setContentHandler(contentHandler); parser.parse(getClass().getResourceAsStream("/SimpleParserTest.xml"), (DefaultHandler) null); @@ -193,7 +177,7 @@ public class SimpleParserTest extends TestCase implements ContentHandler { true); SAXParser parser = factory.newSAXParser(); - parser.getXMLReader().setContentHandler(this); + parser.getXMLReader().setContentHandler(contentHandler); parser.parse(getClass().getResourceAsStream("/SimpleParserTest.xml"), (DefaultHandler) null); |