package jenkins.util;

import org.junit.Test;

import java.util.concurrent.TimeUnit;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;

import static jenkins.util.TimeDuration.*;


public class TimeDurationTest {

    @Test
    public void fromString() throws Exception {
        assertEquals(1, TimeDuration.fromString("1").getTimeInMillis());

        assertEquals(1000, TimeDuration.fromString("1sec").getTimeInMillis());
        assertEquals(1000, TimeDuration.fromString("1secs").getTimeInMillis());
        assertEquals(1000, TimeDuration.fromString("1 secs ").getTimeInMillis());
        assertEquals(1000, TimeDuration.fromString(" 1 secs ").getTimeInMillis());
        assertEquals(1, TimeDuration.fromString(" 1 secs ").getTimeInSeconds());

        assertEquals(21000, TimeDuration.fromString(" 21  secs ").getTimeInMillis());
        assertEquals(21, TimeDuration.fromString(" 21  secs ").getTimeInSeconds());
    }

}
@@ -38,16 +38,52 @@
 it.Test;
+%0Aimport org.jvnet.hudson.test.Issue;
 %0A%0Aimport
@@ -238,16 +238,39 @@
 ion.*;%0A%0A
+@Issue(%22JENKINS-44052%22)
 %0Apublic 

Add @Issue to reference JENKINS-44052