1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.maven.cli;
20
21 import junit.framework.TestCase;
22
23 public class CLIReportingUtilsTest extends TestCase {
24
25 public void testFormatDuration() {
26 assertEquals("0.001 s", CLIReportingUtils.formatDuration(1));
27 assertEquals("0.999 s", CLIReportingUtils.formatDuration(1000 - 1));
28 assertEquals("1.000 s", CLIReportingUtils.formatDuration(1000));
29 assertEquals("59.999 s", CLIReportingUtils.formatDuration(60 * 1000 - 1));
30 assertEquals("01:00 min", CLIReportingUtils.formatDuration(60 * 1000));
31 assertEquals("59:59 min", CLIReportingUtils.formatDuration(60 * 60 * 1000 - 1));
32 assertEquals("01:00 h", CLIReportingUtils.formatDuration(60 * 60 * 1000));
33 assertEquals("23:59 h", CLIReportingUtils.formatDuration(24 * 60 * 60 * 1000 - 1));
34 assertEquals("1 d 00:00 h", CLIReportingUtils.formatDuration(24 * 60 * 60 * 1000));
35 }
36 }