@Test
public void testParseDuration() throws Exception
{

  Assert.assertEquals(ConfigHelper.parseDuration("123", TimeUnit.MILLISECONDS), 123);
  Assert.assertEquals(ConfigHelper.parseDuration(" 123s", TimeUnit.MILLISECONDS), 123000);
  Assert.assertEquals(ConfigHelper.parseDuration("10 MIN ", TimeUnit.MICROSECONDS), 10 * 60 * 1000000);
  Assert.assertEquals(ConfigHelper.parseDuration("70 Hr", TimeUnit.DAYS), 2);
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.DAYS), 2 );
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.HOURS), 2L * 24 );
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.MINUTES), 2L * 24 * 60);
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.SECONDS), 2L * 24 * 60 * 60);
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.MILLISECONDS),
                      2L * 24 * 60 * 60 * 1000);
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.MICROSECONDS),
                      2L * 24 * 60 * 60 * 1000 * 1000);
  Assert.assertEquals(ConfigHelper.parseDuration("2 days", TimeUnit.NANOSECONDS),
                      2L * 24 * 60 * 60 * 1000 * 1000 * 1000);
  Assert.assertEquals(ConfigHelper.parseDuration("70ms", TimeUnit.NANOSECONDS), 70000000);
  Assert.assertEquals(ConfigHelper.parseDuration("1hr", TimeUnit.MILLISECONDS), 1L * 60 * 60 * 1000);
}