You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Claude Warren <cl...@xenei.com> on 2013/09/21 17:22:00 UTC

BaseDatatype strangeness

It seems to me that this should be true.


assertEquals( new BaseDatatype( "
http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"), new BaseDatatype( "
http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"));

But it fails.  Any idea why?



-- 
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: BaseDatatype strangeness

Posted by Claude Warren <cl...@xenei.com>.
Testing the contents of the RecodringModelListener to ensure that the
proper messages are being sent.


On Sun, Sep 22, 2013 at 12:05 PM, Chris_Dollin <eh...@gmail.com> wrote:

> On Sunday, September 22, 2013 11:43:34 AM Claude Warren wrote:
> > I agree.  I will move forward without changing the behaviour, though this
> > makes some tests rather lengthy to write.
>
> Surely not, if it's just assertEquals(bdt1, btd2) that's the problem --
> write
> an equalsBaseDatatype(bdt1, bdt2) method and call it from assert().
> Assuming a suitable equality test can be constructed from public members of
> BaseDatatype. If not you were going to have problems anyway.
>
> What were you catually trying to test?
>
> Chris
>
>
>
>


-- 
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: BaseDatatype strangeness

Posted by Chris_Dollin <eh...@gmail.com>.
On Sunday, September 22, 2013 11:43:34 AM Claude Warren wrote:
> I agree.  I will move forward without changing the behaviour, though this
> makes some tests rather lengthy to write.

Surely not, if it's just assertEquals(bdt1, btd2) that's the problem -- write
an equalsBaseDatatype(bdt1, bdt2) method and call it from assert(). 
Assuming a suitable equality test can be constructed from public members of
BaseDatatype. If not you were going to have problems anyway.

What were you catually trying to test?

Chris




Re: BaseDatatype strangeness

Posted by Claude Warren <cl...@xenei.com>.
I agree.  I will move forward without changing the behaviour, though this
makes some tests rather lengthy to write.

After all contract tests are complete we could make the change and see if
anything breaks.

Claude


On Sun, Sep 22, 2013 at 9:13 AM, Chris_Dollin <eh...@gmail.com> wrote:

> On Saturday, September 21, 2013 04:22:00 PM Claude Warren wrote:
> > It seems to me that this should be true.
> >
> >
> > assertEquals( new BaseDatatype( "
> > http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"), new
> BaseDatatype( "
> > http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"));
> >
> > But it fails.  Any idea why?
>
> BaseDatatype doesn't override .equals().
>
> Perhaps it should. But perhaps there's code that relies on .equals() on
> DaseDatatype being ==. (Seems unlikely but a change in behaviour
> is a change in behaviour ...)
>
> Chris
>



-- 
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: BaseDatatype strangeness

Posted by Chris_Dollin <eh...@gmail.com>.
On Saturday, September 21, 2013 04:22:00 PM Claude Warren wrote:
> It seems to me that this should be true.
> 
> 
> assertEquals( new BaseDatatype( "
> http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"), new BaseDatatype( "
> http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"));
> 
> But it fails.  Any idea why?

BaseDatatype doesn't override .equals().

Perhaps it should. But perhaps there's code that relies on .equals() on
DaseDatatype being ==. (Seems unlikely but a change in behaviour
is a change in behaviour ...)

Chris