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