-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
testXML fails #28
Comments
So? |
It's not a bug to have a failing test? |
The test framework is crap because it depends on the ordering of Objects, ignoring the fact that objects are not ordered. So because of that, the tests are not portable. Is that why the tests are failing for you? There is no way I can answer that given the information you chose to share. |
This is the failure trace: junit.framework.ComparisonFailure: expected:<..."subsonic-response":["playlists":{"playlist":[{"id":"476c65652e6d337"},]"id":"50617274792e78...> but was:<..."subsonic-response":[{"playlists":{"playlist":[{"id":"476c65652e6d3375"},{]"id":"50617274792e78...> at junit.framework.Assert.assertEquals(Assert.java:81) at junit.framework.Assert.assertEquals(Assert.java:87) at org.json.Test.testXML(Test.java:73) The failure doesn't have to do with order. The syntax of the expected text is incorrect in that there appear to be a couple of characters missing. The opening '{' for the right hand side of the "subsonic-response" property. The '{' of the second object in the 'playlist' array, and the last '5' in the first id. |
If toString comparisons are not a reasonable test because of order, but there is a test verifying string to JSONObject, couldn't you make a valid test case by converting the string to a JSONObject and comparing JSONObjects? Assuming there is a JSONObject equals() implementation. I wouldn't mind submitting a patch for it. Better to have test cases that are useful than ones that are inherently not trustworthy. |
Go for it. The current test framework was donated. I am sorry now that I accepted it. |
Test cases for PR stleary#153 in JSON-Java
I just downloaded the source and ran the Test JUnit tests. I'm not sure the expected text is correct.
The text was updated successfully, but these errors were encountered: