Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 46651 invoked from network); 23 Apr 2010 05:03:49 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Apr 2010 05:03:49 -0000 Received: (qmail 55034 invoked by uid 500); 23 Apr 2010 05:03:49 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 54941 invoked by uid 500); 23 Apr 2010 05:03:49 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 54933 invoked by uid 500); 23 Apr 2010 05:03:48 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 54930 invoked by uid 99); 23 Apr 2010 05:03:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 05:03:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 05:03:46 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3N53OOB006115 for ; Fri, 23 Apr 2010 05:03:24 GMT Message-ID: <12721883.2391271999004429.JavaMail.jira@thor> Date: Fri, 23 Apr 2010 01:03:24 -0400 (EDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-2631) Add time millis converter which can convert from String to long In-Reply-To: <9987794.811270974103671.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-2631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59048#action_59048 ] Claus Ibsen commented on CAMEL-2631: ------------------------------------ 5 more things 1) Add a test where you pass in "149" to see if you get the long value of 149 in return. Also test for a negative value such as "-72" to see if you get -72 long value We must make sure that the type converter does not have a side effect of regular String -> long with plain numbers get returned as 0. 2) Add tests where you let Camel use its type converter discover etc something like this. {code} long val = context.getTypeConverter().convertTo(long.class, "149"); long val = context.getTypeConverter().convertTo(long.class, "5min"); {code} 3) In the Timer test use the StopWatch to test that it takes that long to run, eg about 10 seconds. 4) Check the links from Hadrian, we can use case insensitive mode on the reg exp so people can spell it HOUR etc and still have it converted. 5) You do not need to reset the matcher, when you actually create a new instance of it for the next test. So its just a waste of code :) > Add time millis converter which can convert from String to long > --------------------------------------------------------------- > > Key: CAMEL-2631 > URL: https://issues.apache.org/activemq/browse/CAMEL-2631 > Project: Apache Camel > Issue Type: New Feature > Components: camel-core > Reporter: Claus Ibsen > Assignee: Ashwin Karpe > Priority: Minor > Attachments: time-pattern-converter-patch4.diff > > > Its currently a bit annoying to set a delay by millis and if you need, like 1 hour 30 min period. What is this in millis? > We should add a TypeConverter for that which has a String notation such as: > {code} > 1h30m > 3h45m25s > 10m > 15m20s > 30s > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.