camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <>
Subject [jira] Commented: (CAMEL-2631) Add time millis converter which can convert from String to long
Date Fri, 23 Apr 2010 05:03:24 GMT


Claus Ibsen commented on CAMEL-2631:

5 more things

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.

Add tests where you let Camel use its type converter discover
etc something like this.

long val = context.getTypeConverter().convertTo(long.class, "149");

long val = context.getTypeConverter().convertTo(long.class, "5min");

In the Timer test use the StopWatch to test that it takes that long to run, eg about 10 seconds.

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.

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:
>             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.

View raw message