cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: why JSONProviderTest.testReadQualifiedCollection()/testReadQualifiedArray() disabled?
Date Wed, 30 Mar 2011 10:25:01 GMT
Hi Joerg

On Wed, Mar 30, 2011 at 11:06 AM, joerg@kiegeland.com
<joerg@kiegeland.com>wrote:

>
>  Please see [1], I've just uploaded a slightly refactored patch, named
>> json-collections.patch.
>> Can you please look at it ? Just something minor is missing, I can get to
>> it
>> later on, but if you can apply it to the latest code and see where the
>> missing bit is then may be we can close [1] :-)
>>
>>
> I have fixed something in MappedXMLStreamReader, in the constructor:
>
> this.node = new Node(null, rootName, obj, convention);
>
> instead of
>
> this.node = new Node(null, rootName, ((JSONArray)top).getJSONObject(0),
> convention);
>
> So the old implementation just not read the array items with index>0.
>
> Also after the line ..
>
> nextKey = node.getName().getLocalPart();
>
> .. I inserted following:
>
> if (!"".equals(node.getName().getNamespaceURI()))
>                                        nextKey =
> this.convention.getPrefix(node.getName().getNamespaceURI()) + "." + nextKey;
>
> So actually to qualify "nextKey" if there is namespace info. This is
> required for testReadQualifiedCollection() as it uses the qualified name
> "ns1.thetag". When not augmenting with this qualification, the collection
> component type just cannot be resolved, resulting that a generic
> ElementNSImpl instead of the collection component type is instantiated.
>
> So with these two changes, all tests of JSONProviderTest run,
> and also all of mine tests (I do not use any explicite namespaces or
> qualified JSON attribute names).
>
>
Brilliant, thanks.


> Sergey , can you check-in these changes?
>
>
I'm not a committer but I will try to make sure the changes make it into the
trunk. I'll run Jettison tests locally and create a JIRA with your patch and
send you the link. There's another Jettison related issue open in CXF - will
have to address it too. Looks like we do have a chance to have Jettison
1.2.1 out before 2.4.0 is released :-).

Cheers, Sergey

Cheers,
> Joerg
>



-- 
Sergey Beryozkin

Application Integration Division of Talend <http://www.talend.com>
http://sberyozkin.blogspot.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message