summaryrefslogtreecommitdiff
path: root/luni/src/test/java/libcore/xml
Commit message (Collapse)AuthorAgeFilesLines
* Inclusive Language Fixit: Replace dummy with fakePaul Duffin2020-07-281-2/+2
| | | | | | Bug: 162205877 Test: m java Change-Id: I294a033305448533d101349dc41bd216ce2ec63f
* Rename org.kxml2 code to com.android.org.kxml2Neil Fuller2018-07-114-5/+5
| | | | | | | | | | | org.kxml2 code is heavily modified in Android so renaming it to a reserved package name will not make it less maintainable. This rename should also flush out users who are depending on the parser package name. Bug: 111055375 Test: build Change-Id: Idfe871ef7b24fd60d706b932ff2dc52eb9fbf4b6
* Automated: Canonicalize spelling of Android-changed across libcoreTobias Thierer2017-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies the same regexp replacement across libcore that http://r.android.com/345826 had only applied to ojluni. Most of the previous noncanonical spellings were a lowercased "android-" that should be "Android-". This CL was created by running the following command on top of the above CL. No manual changes were made. find . -name \*\.java | xargs sed -i \ -e 's/Android[- ]changed/Android-changed/ig' \ -e 's/Android-changed :/Android-changed:/g' \ -e 's/Android-changed \(BEGIN\|END\)/\1 Android-changed/g' \ -e 's/Android-changed - /Android-changed: /g' \ -e 's/Android[- ]removed/Android-removed/ig' \ -e 's/Android-removed :/Android-removed:/g' \ -e 's/Android-removed \(BEGIN\|END\)/\1 Android-removed/g' \ -e 's/Android-removed - /Android-removed: /g' \ -e 's/Android[- ]added/Android-added/ig' \ -e 's/Android-added :/Android-added:/g' \ -e 's/Android-added \(BEGIN\|END\)/\1 Android-added/g' \ -e 's/Android-added - /Android-added: /g' \ -e 's/----- \(BEGIN\|END\) android\( -----\)\?/\1 Android-changed/g' \ -e 's/\/\* \(BEGIN\|END\) Android-changed \*\//\/\/ \1 Android-changed/g' Bug: 35841464 Test: make droid cts Change-Id: I060c7236b7607763e5d27d60aa395d2507703a95
* Update tests to match behavior of expat 2.2.0Paul Duffin2017-02-281-6/+8
| | | | | | | | | | | | | | Expat 2.2.0 outputs a slightly different error message that caused a test to fail but the behavior is still acceptable. This updates the affected test to match and updates related tests to check the whole message including location. That protects against a recurrence of the previous bug where it could report non-deterministic error messages and locations as it scanned past the end of the buffer and on through the heap. Bug: 30157673 Test: cts-tradefed run cts -m CtsLibcoreTestCases -t libcore.xml.ExpatSaxParserTest Change-Id: Ibbfe103675078b0c8330fb6c1ce28eda769d9df6
* Fix 58 libcore tests that caught "expected" Exceptions but didn't fail()Tobias Thierer2016-09-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were no changes to code under test. 4 tests were fixed to not tolerate an Exception: - libcore.java.util.CollectionsTest#test_CheckedMap_computeIfAbsent In the case where a Map key is present, computeIfAbsent() should not invoke the Function, so there is no return value that could be expected to undergo a type check. The test was changed to verify that the Function is not invoked. - libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_sort and libcore.java.util.concurrent.CopyOnWriteArrayListTest#test_subList_sort were sorting an already-sorted non-null list that contains no null values. That logic was redundant and wouldn't have thrown. - org.apache.harmony.security.tests.java.security.KeyStoreSpiTest#test_engineEntryInstanceOf (the KeyStoreSpi documentation does not mention whether NPE is thrown; the implementation comes from upstream and does not throw it). 54 tests were fixed by adding the missing fail(); No attempt was made to make this failure message specific to the exception that was expected. Tests that weren't changed: - SSLEngineTest.test_wrap_ByteBuffer_ByteBuffer_04() requires investigation to determine the correct resolution. A comment was added to the test linking to the corresponding bug. - ThreadTest#testParkUntilWithUnderflowValue() and OldNodeChangeEventTest.waitForEvent() were not touched since it was not clear whether that it was relevent to the test whether or not the exception was thrown. - two cases in Files2Test#test_setPosixFilePermissions_NPE() are left to a future CL Test: (croot; make vogar core-tests) \ && git diff aosp/master --name-only | xargs vogar `cparg core-tests` Change-Id: I1cd3220a06e331ff049b146b393f78879f07211a
* Merge \"Tidy up MockWebServer usage\"Neil Fuller2016-06-291-0/+1
|\ | | | | | | | | | | am: a412e1368f Change-Id: I57a0b600f8887c220fc2f801744af02f862254f6
| * Tidy up MockWebServer usageNeil Fuller2016-06-291-0/+1
| | | | | | | | | | | | | | | | | | Make sure that MockWebServer instances are shut down correctly after tests. Test: Ran the tests under CTS Bug: 29820565 Change-Id: I5455de018e2e6e3dd57cfc572becc93e0f566a26
* | Add tests for security vulnerability CVE-2016-0718Paul Duffin2016-05-241-0/+49
|/ | | | | | | The fixes are in external/expat. Bug: 28698301 Change-Id: Ia8c17873409370884238484903faf08ee3b58e11
* Fix PullParser reuse regressionNeil Fuller2015-08-271-4/+18
| | | | | | | | | | | | | | Commit 0424d12f9b8a19c4a451282bc8ae974f6109424d introduced a regression: calling setInput() would not fully reset the parser iff the parser had already parsed a <!DOCTYPE tag. This change contains a fix and a test. Thanks to mike@ for the report. Bug: https://code.google.com/p/android/issues/detail?id=182605 Change-Id: Icddc1c52bca3beaba7f5ee662d18757d6fce6cf2
* Handle whitespaces after DOCTYPE elementWojciech Staszkiewicz2015-05-061-0/+16
| | | | | | | | | | This change fixes a bug where a whitespace after DOCTYPE element in a file would cause the file to be unparsable. It also adds a regresion test. bug: https://code.google.com/p/android/issues/detail?id=171828 Change-Id: I1036b17833c12bc275c058b835fb8f02665edfae
* Improve support for non-BMP characters in XML.Elliott Hughes2014-10-181-9/+66
| | | | | | | | | | | This adds support for writing surrogate pairs out as entity references in KXmlSerializer and for parsing non-BMP entity references in DocumentBuilderImpl. Emoji and XML. Two of my least favorite things together at last. Bug: 17960630 Change-Id: If5e1001faf250e87e6eeebe3449a6ebc115789a1
* Fix compatibility issues in XmlPullParserFactory.Narayan Kamath2014-02-131-1/+341
| | | | | | | | | | | | | | | | | | | - We should set features on a parser only if the feature value is true. I.e, we guarantee that we'll never call XmlPullParser.setFeature(..., false). - In change 0363556bad8930a, we didn't consider the fact that apps could extend XmlPullParserFactory and modify protected fields to change the parser / serializer that's instantiated. I've reinstated this feature, despite the fact that it's a particularly pointless feature on a more-or-less pointless public API. Apps can and should instantiate their own parser instances directly instead of going through this factory. bug: 12956724 Change-Id: I793eba335b5385eb641e023b3613bba4515a85bf
* Simplify code in XmlPullParserFactory.Narayan Kamath2013-10-171-0/+34
| | | | | | | | | | | | | | Since we're hard coding KXmlParser and KXmlSerializer anyway, we might as well do it more directly. Also add a trivial unit test for this method. NOTE: This change preserves existing behaviour and doesn't throw from #newInstance if the parser class couldn't be found or instantiated. We instead throw from newPullParser or newSerializer as appropriate. Change-Id: Ic0c86e67691b8e662d95363bbe597d3abb7c3642
* Fix unexpected EOF handling by KXmlParser.Vladimir Marko2013-06-281-0/+34
| | | | | | | | | | Avoid read position slipping beyond limit on EOF, causing an ArrayIndexOutOfBoundsException. Also fix two incorrect checks whether to read more data. Bug: 9012715 Change-Id: I40f60becd97eb4d9f33842bea2c19e9dc531d3b7
* Fix InnerNodeImpl.insertBefore.Elliott Hughes2012-11-261-0/+13
| | | | | | | | As the submitter said, an insertBefore with a null refChild should be taken as a request to append. Bug: http://code.google.com/p/android/issues/detail?id=24530 Change-Id: I26141e2d4dd7a7805209a455a7c16bf0f26e7acf
* Add a test for KxmlSerializer attributes with whitespace chars.Jesse Wilson2012-08-011-10/+120
| | | | | | | | | Delete some unused Kxml classes while I'm in the area, and combine our two classes named KXmlSerializerTest. (cherry-pick of 22a12704190060f74e308a5b5aa32d0b7f715183.) Change-Id: Id8b3f72edc58547e49ad86c51a171dce3669be3f
* Tests to demonstrate that KxmlSerializer and DOM writing both work.Jesse Wilson2012-08-012-0/+132
| | | | | | | | | | | | | | A user reported that he expected &quot; instead of " in text nodes of the emitted document. The user is wrong, but we don't have any tests that demonstrate either case. I wrote tests for both DOM writing and KxmlSerializer since there's no "RI" for the KxmlSerializer and I wanted evidence that " is commonplace. (&quot; is permitted according to the spec.) (cherry-pick of 75595b3b8136ac524570125d74f748f0b0424428.) Bug: http://code.google.com/p/android/issues/detail?id=21250 Change-Id: I1b219a5c8d06551c4e7ac72a6df262df6b64209f
* Remove run-core-tests from known failures.Jesse Wilson2012-01-034-17/+0
| | | | | | | | The @KnownFailure annotations are unnecessary and the expectations are all obsolete. Bug: http://b/3087671 Change-Id: I5dd834323770da09090b4e76c3f6793f1ccc629d
* Warn about a fixed bug in XmlPullParser.nextText()Jesse Wilson2011-11-111-0/+22
| | | | | Bug: http://code.google.com/p/android/issues/detail?id=21425 Change-Id: I4c69d67bb8bfdf3f78359d800860d5dc2e2e349f
* Add another test to demonstrate that getElementsByTagName works.Jesse Wilson2011-06-241-1/+8
| | | | | Change-Id: I05246b7a990302d712f0022a0ecd951aa30b95d4 http://code.google.com/p/android/issues/detail?id=17907
* Use external/mockwebserver in libcoreJesse Wilson2011-06-071-2/+2
| | | | Change-Id: I4dac34f88b23484643bce31e5f25ac6eb1fea426
* Merge "Fix some failing XML tests." into dalvik-devJesse Wilson2011-05-171-80/+24
|\
| * Fix some failing XML tests.Jesse Wilson2011-05-171-80/+24
| | | | | | | | Change-Id: I7504e849b9fe67900248a2e223d189c8fcef224d
* | am 5d284194: am a0376753: am 6ce8e6ee: Skip BOM characters even with an ↵Jesse Wilson2011-05-172-1/+57
|\ \ | |/ |/| | | | | | | | | explicit charset. * commit '5d28419405d27a906426bb2a5a56a8ccdc2b38af': Skip BOM characters even with an explicit charset.
| * Skip BOM characters even with an explicit charset.Jesse Wilson2011-05-161-1/+26
| | | | | | | | | | Change-Id: I697448528324cd68196d00ebf82ee8eecb72148d http://code.google.com/p/android/issues/detail?id=16892
* | Merge "Fix CloseGuard warning in XsltXPathConformanceTestSuite." into dalvik-devJesse Wilson2011-04-151-28/+27
|\ \
| * | Fix CloseGuard warning in XsltXPathConformanceTestSuite.Jesse Wilson2011-02-211-28/+28
| | | | | | | | | | | | | | | | | | | | | This method is used by many tests; fixing this resolves many warnings. Change-Id: I1b17fb75e8e370e980850081a0c99a242a5c1de7
* | | Permit general and parameter entity features to be disabled for Expat SAX.Jesse Wilson2011-03-281-7/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://code.google.com/p/android/issues/detail?id=9493 (We'll keep supporting the native Expat parser until the the Java Kxml parser is as fast). Change-Id: I6492634a777a591f5da4ea7a4cdeca81c1f6cc65
* | | Rescue some XML tests to a libcore.xml package.Jesse Wilson2011-03-287-0/+3053
| | | | | | | | | | | | | | | | | | Our XML tests are no longer split across packages for no good reason. Change-Id: I0fbc9e96216b6b604ef4360d343fce9fecf7d34a
* | | Fix closeguard warning in XsltXPathConformanceTestSuiteJesse Wilson2011-03-071-0/+1
|/ / | | | | | | Change-Id: I25e4bd916612b8ddda7231cdbf6429abc5842893
* | Merge commit '995a3842' into manualmergeJesse Wilson2011-02-142-74/+54
|\| | | | | | | | | | | | | Conflicts: expectations/knownfailures.txt Change-Id: Iee137d2c0c5e8bfa6994258f5fab8e07caeb86e1
| * Fail parsing if there's text outside the document element.Jesse Wilson2011-02-142-74/+54
| | | | | | | | | | | | | | | | We have a similar bug for misplaced DTDs. This is tested but not fixed by this change. Change-Id: I8e06ec9197cb8c4135212056ab791c254c9dcc3d http://b/3452274
* | Remove the ExpatPullParser.Jesse Wilson2011-01-092-53/+0
|/ | | | | Change-Id: Ie10697ed917e3f4b162b668096ced90c90f79c67 http://b/3090550
* Capture the DTD body while it is being parsed.Jesse Wilson2010-12-202-11/+49
| | | | | Change-Id: Ibef02ca759eb56a00f0f72f4063d129ef5350d21 http://b/3241492
* The last of the Kxml correctness fixes for Expat compatibility.Jesse Wilson2010-11-302-25/+34
| | | | | | | | | With this change we should be able to drop the Expat pull parser and use Kxml exclusively. I'm deferring that change until after the current release. Change-Id: I7c6d6dfe6c1e9ae9417c48603068ddd4ade78b76 http://b/3090550
* Fix XML DOM test failures and close guard warnings.Jesse Wilson2010-11-291-13/+53
| | | | | | | | | | | | Fix KxmlParser to capture the DTD's root element name, system ID and public ID. This is more robust than capturing the same in the pull-to-DOM adapter. Fix close guard warnings in XML tests. Close input streams of resource files. Don't catch exceptions only to call fail(). http://b/3090550 Change-Id: I7cfafde58cc28af79c48386a4d124803c8791328
* Resolve entity values recursively and support default attributes.Jesse Wilson2010-11-283-5/+136
| | | | | Change-Id: Ib32040e0ebe8ef52e8d382fb65ab4d08779901b7 http://b/3090550
* Implement DTD parsing in KxmlParser.Jesse Wilson2010-11-231-0/+37
| | | | | | | | | | | This change still has some problems: - default attribute values are not honored. - the doctype token text is lost - entity values are not reparsed - use of parameter entities is ignored but should cause a failure Change-Id: Idd543846840aea481730e690e63212164555cdf1 http://b/3090550
* Test the behavior of pull parser DTD parsing / handling.Jesse Wilson2010-11-224-34/+393
| | | | | Change-Id: Ic8560bf066de05c314801a403966be945974957d http://b/3090550
* Move XML parser tests out of apache/harmony/xml.Jesse Wilson2010-11-227-0/+2591
These tests weren't written by Harmony; we were using that name because we didn't have a better one. Today we do: "libcore". Change-Id: I0e250874b2d66d7e6d4e40df877475a0d52c7fe1