lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: GData tests
Date Thu, 20 Sep 2007 18:53:25 GMT
:             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!)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message