Here's the error I get when running on zones:

Testcase: testFormatDate (org.apache.lucene.gdata.utils.TestDateFormater): FAILED [junit] Sun, 23 Sep 2007 01:29:06 GMT+00:00 does not match expected pattern [junit] junit.framework.AssertionFailedError: Sun, 23 Sep 2007 01:29:06 GMT+00:00 does not match expected pattern [junit] at org.apache.lucene.gdata.utils.TestDateFormater.testFormatDate (TestDateFormater.java:41)

And here's the pattern:
"[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}"

The problem is the +00:00 at the end. My guess is that last part should be optional.

I will open a bug.

-Grant

On Sep 20, 2007, at 2:53 PM, Chris Hostetter 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!)



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to