mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
26.31.2013 efa949b25f472d7e4c39733678d8f0e5229f8201
opendj-sdk/opendj-admin/src/test/java/org/opends/server/admin/DurationUnitTest.java
@@ -30,7 +30,8 @@
import static org.testng.Assert.*;
import org.forgerock.opendj.config.ConfigTestCase;
import org.testng.annotations.*;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
@SuppressWarnings("javadoc")
public class DurationUnitTest extends ConfigTestCase {
@@ -38,18 +39,18 @@
    @DataProvider(name = "testGetUnitData")
    public Object[][] createStringToSizeLimitData() {
        return new Object[][] {
                { "ms", MILLI_SECONDS },
                { "milliseconds", MILLI_SECONDS },
                { "s", SECONDS },
                { "seconds", SECONDS },
                { "m", MINUTES },
                { "minutes", MINUTES },
                { "h", HOURS },
                { "hours", HOURS },
                { "d", DAYS },
                { "days", DAYS },
                { "w", WEEKS },
                { "weeks", WEEKS } };
            { "ms", MILLI_SECONDS },
            { "milliseconds", MILLI_SECONDS },
            { "s", SECONDS },
            { "seconds", SECONDS },
            { "m", MINUTES },
            { "minutes", MINUTES },
            { "h", HOURS },
            { "hours", HOURS },
            { "d", DAYS },
            { "days", DAYS },
            { "w", WEEKS },
            { "weeks", WEEKS } };
    }
    @Test(dataProvider = "testGetUnitData")
@@ -65,15 +66,15 @@
    @DataProvider(name = "valueToStringData")
    public Object[][] createValueToStringData() {
        return new Object[][] {
                { 0L, "0 ms" },
                { 1L, "1 ms" },
                { 999L, "999 ms" },
                { 1000L, "1 s" },
                { 1001L, "1 s 1 ms" },
                { 59999L, "59 s 999 ms" },
                { 60000L, "1 m" },
                { 3599999L, "59 m 59 s 999 ms" },
                { 3600000L, "1 h" } };
            { 0L, "0 ms" },
            { 1L, "1 ms" },
            { 999L, "999 ms" },
            { 1000L, "1 s" },
            { 1001L, "1 s 1 ms" },
            { 59999L, "59 s 999 ms" },
            { 60000L, "1 m" },
            { 3599999L, "59 m 59 s 999 ms" },
            { 3600000L, "1 h" } };
    }
    @Test(dataProvider = "valueToStringData")