lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless" <luc...@mikemccandless.com>
Subject Re: GData tests
Date Thu, 20 Sep 2007 19:42:59 GMT
"Chris Hostetter" <hossman_lucene@fucit.org> wrote:
> :             java.util.regex.Pattern pattern = 
> java.util.regex.Pattern.compile("[A-Z][a-z]{1,2}, [0-9]{1,2}
> [A-Z][a-z]{2} [0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [A-Z]{2,4}");
> :             Date date = new Date();
> :             String formatedDate =
> DateFormater.formatDate(date,DateFormater.HTTP_HEADER_DATE_FORMAT);
> :             assertTrue(pattern.matcher(formatedDate).matches());   //
> THIS ASSERT FAILS
> 
> it doesn't fail for me, but it does look very TimeZone sensitive, the 
> pattern the formatedDate is tested against doesn't look like it would be 
> too freindly to non-US timezones.
> 
> a simple start is to get the test to be more verbose on failure ... i
> just 
> tweaked the asert to tell you exactly what string didn't match the
> pattern 
> if it fails  (hmm.. someone else just made it write the date to stdout .. 
> now we'll know twice!)

That would be me!  But I like your more-permanent solution better so
I just reverted mine :)

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message