The tests assume your locale for the timezone, which I think is the problem
- for anyone East of me it will work but could well fail for people to the
West :-)
Ian
On Wed Jan 14 2015 at 11:05:20 PM Jody Garnett <jody.garn...@gmail.com>
wrote:
> Got no real insight here Ian. The one using a Data object does it assign a
> timezone? Or is assuming your current locale. I would update the test to
> create the Date with a known timezone before expecting consistent results.
> --
> Jody
>
> --
> Jody Garnett
>
> On 14 January 2015 at 08:32, Ian Turton <ijtur...@gmail.com> wrote:
>
>> While messing with SQLServer I've hit an issue with one of the date tests
>> failing. It passes on master even though the same issue is present in the
>> convertor. So I'm unsure as to what I'm doing wrong - if you consider this
>> test (that could be added to TemporalConvertorFactoryTest in main
>> org.geotools.utils )
>>
>> public void testDatetoDate() throws Exception {
>> Date date = new SimpleDateFormat("yyyy-dd-MM").parse("2009-28-06");
>> assertNotNull(factory.createConverter(Date.class,
>> java.sql.Date.class, null));
>>
>> java.sql.Date output = (java.sql.Date)
>> factory.createConverter(Date.class, java.sql.Date.class,
>> null).convert(date, java.sql.Date.class);
>>
>> assertEquals("2009-06-28", output);
>> }
>>
>> It fails as the convertor reduces the time to GMT which forces it in the
>> previous day (if you are in the UK anyway) so the answer comes back as
>> 2009-06-27. I can't decide if this is correct or not and the comments don't
>> offer any help.
>>
>> But in the JDBCDateTests testFilterByDate - runs two queries one with
>> 2009-06-29 as a string and once as a date object. The first correctly
>> returns 2 rows and the second fails as it only returns 1 bacause the day
>> has changed.
>>
>> But I can't see any changes I've made between my sqlserver-jtds branch
>> and master that would cause this to work before. So if anyone can throw
>> some light on this I'd be very grateful.
>>
>> Cheers
>>
>> Ian
>>
>>
>> ------------------------------------------------------------------------------
>> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
>> GigeNET is offering a free month of service with a new server in Ashburn.
>> Choose from 2 high performing configs, both with 100TB of bandwidth.
>> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
>> http://p.sf.net/sfu/gigenet
>> _______________________________________________
>> GeoTools-Devel mailing list
>> GeoTools-Devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>>
>>
>
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel