stleary / JSON-Java-unit-test

Junit test harness to validate the JSON-Java GitHub project code.
Apache License 2.0
28 stars 45 forks source link

Complete unit tests for XML.toJSONObjectReader() #24

Closed dtaillard closed 9 years ago

dtaillard commented 9 years ago

This branch introduces changes that should finish unit tests for XML.toJSONObjectReader(). I have changed many of the tests to start using compareStringToJSONObject(),compareReaderToJSONObject(), and compareFileToJSONObject().

Tell me what you think.

stleary commented 9 years ago

Thanks, will review and respond soon. Quick impression, looks good.

stleary commented 9 years ago

Are you sure this is the version you wanted to commit? It does not seem to compile. Also there are a few methods where some of the test functionality was removed. For example, in shouldHandleToString(), the intent was to confirm that the XML.toString() method worked correctly. In the new code, XML.toString() is never called.

dtaillard commented 9 years ago

Well, I messed up there. I'll fix it. I think that a build system (like gradle) would make it much easier to build the project, rather than trying to add the jUnit dependency manually. Why are the source files not in the org.json.junit.package as declared with the package statement at the top of each source file? Could I add create the actual package so that it compiles?

stleary commented 9 years ago

I use Eclipse. Would be interested in seeing your gradle build scripts when you are done. Regarding the source files, I think you are asking why they are not found in a directory structure that matches the package declaration. That will probably be fixed when I post the test code to the Maven central repository, in a future release.

dtaillard commented 9 years ago

My latest commit fixes the errors, and should bring that functionality back.

stleary commented 9 years ago

Will get to this as soon as I can - been having a busy week.

stleary commented 9 years ago

Can't be accepted as is. Syntax error:at line 48, compareJSONObjectToString() is not a method.

Some tests throw exceptions:or fail

Let me mavenize both probjects and provide instructions on how to run the unit tests, and we can work from there. Will have something ready for you soon.

dtaillard commented 9 years ago

Just let me know when you can provide instructions. :+1:

stleary commented 9 years ago

Will do, currently caught up in sprint catch up work. Seems to happen towards the end of every sprint.

dtaillard commented 9 years ago

No rush.