Re: [robolectric] JSONObject throws RuntimeException -> Pivotal: Is this solution okay?)

98 views
Skip to first unread message

Ethan Close

unread,
Dec 8, 2011, 12:25:42 PM12/8/11
to robol...@googlegroups.com
I think that's a great question. I'm curious if it's even a valid solution to the problem. Does anyone at Pivotal know if this is an acceptable solution?

Ethan.

On 7 December 2011 23:50, Logdog82 <logd...@gmail.com> wrote:
Thanks. It works. But why is the json.jar not included in Robolectric? hmm..



--
Ethan Close
m: +1.415.913.0117 | skype: ethanclose | et...@inqmobile.com 
INQ Mobile, 139 Townsend Street Suite 400, San Francisco, CA 94107







This e-mail is only intended for the person(s) to whom it is addressed and may contain CONFIDENTIAL information. Any opinions or views are personal to the writer and do not represent those of INQ Mobile Limited, Hutchison Whampoa Limited or its group companies.  If you  are not the intended recipient, you are hereby notified that any use, retention, disclosure, copying, printing, forwarding or dissemination of this communication is strictly prohibited. If you have received this  communication in error, please erase all copies of the message and its  attachments and notify the sender immediately. INQ Mobile Limited is  a company registered in the British Virgin Islands. www.inqmobile.com.


Tyler Schultz

unread,
Dec 8, 2011, 10:31:11 PM12/8/11
to robol...@googlegroups.com
Here's the long story:
At one time we built the jars from an ant task - 'jar-all'.  All of the jars that are in the lib/main directory were packaged into the jar, with some exclusions. From reading the task now it appears the json-xxx.jar would have been included. At the end of 2010 we switched over to building the jars with maven. I'm looking at the pom file and there is no dependecy on the org.json library. There is nothing in robolectric that requires the json jar, so there's no dependency, and therefore the 'with dependencies' jar does not include it.

The short story:
Robolectric used to include it, but now it doesn't. 

While it seems the with dependencies jar should include org.json, it does seem wrong to depend on the jar if its not required. I could be convinced either way. 
I'm sorry you've had to waste time wondering about it. If you're having this issue, then others are probably too. I guess that means we should add it to the pom. What do you think?

--Tyler

Ethan Close

unread,
Dec 11, 2011, 8:00:42 PM12/11/11
to robol...@googlegroups.com
Since the org.json package is in android.jar, it seems like it should be included in the robolectric jar.

Ethan.

Tom Dignan

unread,
Nov 13, 2012, 5:49:51 PM11/13/12
to robol...@googlegroups.com
It would be excellent if the json lib was included in robolectric-with-dependencies.jar. Currently wrestling with that issue now (using ant, not maven here)

Phil Goodwin

unread,
Nov 13, 2012, 6:07:34 PM11/13/12
to robol...@googlegroups.com
I think that including it would satisfy the principal of least surprise.

Tom Dignan

unread,
Nov 13, 2012, 11:09:09 PM11/13/12
to robol...@googlegroups.com
I just compiled the latest robolectric from github and in there it seems included :)!!!!
Reply all
Reply to author
Forward
0 new messages