[Seaside] Failing test for #fromJson:

John McKeon p3anoman at gmail.com
Sat Jun 23 15:37:16 UTC 2012


In an effort to redeem myself after making that totally idiotic statement
in my prior post, I have updated Magritte-Json and Magritte-Tests-Json to
make the additional test pass. Unfortunately I had to define kind: on the
descriptions to get it to work. I really do not see any other way.
I also added another (failing) test for adding Other Addresses to the JSON
string.

Hope this helps.
John

On Thu, Jun 21, 2012 at 5:40 AM, Tomas Kukol <tomas.kukol at gmail.com> wrote:

> Hello,
>
> I am using Margitte-Json and Magritte-Tests-Json. MJTestPerson and
> MJTestAddress are part of Magritte-Tests-Json package and these
> classes have both magritte descriptions. There are codes for both
> classes:
>
>
>
> On Wed, Jun 20, 2012 at 5:02 PM, Philippe Marschall
> <philippe.marschall at gmail.com> wrote:
> > On Wed, Jun 20, 2012 at 2:23 PM, Tomas Kukol <tomas.kukol at gmail.com>
> wrote:
> >> Hello,
> >>
> >> I have created a test for #fromJson: message.
> >>
> >> MJTestFromJson >> testFromJsonWithAddress
> >>       | person address |
> >>       person := MJTestPerson fromJson:
> >> '{"Name":"Tomas","Address":{"PostalCode":"19800","City":"Prague"}}'.
> >>
> >>       self assert: person name equals:  'Tomas'.
> >>       address := person address.
> >>       self assert: address isNil not.
> >>       self assert: address postalCode equals: '19800'.
> >>       self assert: address city equals: 'Prague'.
> >>
> >> But the test fails because it cannot find PostalCode in MJTestPerson
> >> instace (should be probably in MJTestAddress). Is it a problem of my
> >> #fromJson: usage or wrong implementation of JSON deserialization?
> >
> > Are you using Magritte-JSON? If you can you show us the descriptions,
> > ideally attach the whole MJTestPerson class?
> >
> > Cheers
> > Philippe
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20120623/f03bb542/attachment.htm


More information about the seaside mailing list