public class InfoTest extends TestCase {
private static final transient Logger LOGGER = LoggerFactory.getLogger(TestCase.class);
public void testUptime() throws Exception {
InfoAction infoAction = new InfoAction();
// uptime 30 seconds
assertEquals("30.000 seconds", infoAction.printDuration(30 * 1000));
// uptime 2 minutes
assertEquals("2 minutes", infoAction.printDuration(2 * 60 * 1000));
// uptime 2 hours
assertEquals("2 hours", infoAction.printDuration(2 * 3600 * 1000));
// update 2 days and 2 hours
assertEquals("2 days 2 hours", infoAction.printDuration(50 * 3600 * 1000));
}