From java-dev-return-21449-apmail-lucene-java-dev-archive=lucene.apache.org@lucene.apache.org Thu Sep 20 18:53:58 2007 Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 81333 invoked from network); 20 Sep 2007 18:53:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Sep 2007 18:53:57 -0000 Received: (qmail 17175 invoked by uid 500); 20 Sep 2007 18:53:46 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 16804 invoked by uid 500); 20 Sep 2007 18:53:46 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 16793 invoked by uid 99); 20 Sep 2007 18:53:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2007 11:53:45 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.69.42.181] (HELO radix.cryptio.net) (208.69.42.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Sep 2007 18:55:47 +0000 Received: by radix.cryptio.net (Postfix, from userid 1007) id 9E81E71C0EF; Thu, 20 Sep 2007 11:53:25 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by radix.cryptio.net (Postfix) with ESMTP id 5F17571C09C for ; Thu, 20 Sep 2007 11:53:25 -0700 (PDT) Date: Thu, 20 Sep 2007 11:53:25 -0700 (PDT) From: Chris Hostetter To: java-dev@lucene.apache.org Subject: Re: GData tests In-Reply-To: <1190279082.7712.1211640301@webmail.messagingengine.com> Message-ID: References: <1635B1A7-8BF4-4C87-95F0-24B20302930C@apache.org> <46F21B6F.3010202@gmail.com> <1190277585.3389.1211636683@webmail.messagingengine.com> <1190279082.7712.1211640301@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org : 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: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org