Examples of inSeconds()


Examples of com.google.code.tempusfugit.temporal.Duration.inSeconds()

    @Test
    public void convertSeconds() {
        Duration duration = seconds(60);
        assertThat(duration.inMillis(), is(60000L));
        assertThat(duration.inSeconds(), is(60L));
        assertThat(duration.inMinutes(), is(1L));
        assertThat(duration.inHours(), is(0L));
        assertThat(duration.inDays(), is(0L));
    }
View Full Code Here

Examples of com.google.code.tempusfugit.temporal.Duration.inSeconds()

    @Test
    public void convertSecondsRoundingResult() {
        Duration duration = seconds(95);
        assertThat(duration.inMillis(), is(95000L));
        assertThat(duration.inSeconds(), is(95L));
        assertThat(duration.inMinutes(), is(1L));
        assertThat(duration.inHours(), is(0L));
        assertThat(duration.inDays(), is(0L));
    }
View Full Code Here

Examples of com.google.code.tempusfugit.temporal.Duration.inSeconds()

    @Test
    public void convertMinutes() {
        Duration duration = minutes(50);
        assertThat(duration.inMillis(), is(3000000L));
        assertThat(duration.inSeconds(), is(3000L));
        assertThat(duration.inMinutes(), is(50L));
        assertThat(duration.inHours(), is(0L));
        assertThat(duration.inDays(), is(0L));
    }
View Full Code Here

Examples of com.google.code.tempusfugit.temporal.Duration.inSeconds()

    @Test
    public void conversionHours() {
        Duration duration = hours(24);
        assertThat(duration.inMillis(), is(86400000L));
        assertThat(duration.inSeconds(), is(86400L));
        assertThat(duration.inMinutes(), is(1440L));
        assertThat(duration.inHours(), is(24L));
        assertThat(duration.inDays(), is(1L));
    }
View Full Code Here

Examples of com.google.code.tempusfugit.temporal.Duration.inSeconds()

    public void convertDays() {
        Duration duration = Duration.days(10L);
        assertThat(duration.inDays(), is(10L));
        assertThat(duration.inHours(), is(duration.inDays() * HOURS_IN_A_DAY));
        assertThat(duration.inMinutes(), is(duration.inHours() * MINUTES_IN_AN_HOUR));
        assertThat(duration.inSeconds(), is(duration.inMinutes() * SECONDS_IN_A_MINUTE));
        assertThat(duration.inMillis(), is(duration.inSeconds() * MILLIS_IN_A_SECOND));
    }

    @Test
    public void canAddDurations() {
View Full Code Here

Examples of com.google.code.tempusfugit.temporal.Duration.inSeconds()

        Duration duration = Duration.days(10L);
        assertThat(duration.inDays(), is(10L));
        assertThat(duration.inHours(), is(duration.inDays() * HOURS_IN_A_DAY));
        assertThat(duration.inMinutes(), is(duration.inHours() * MINUTES_IN_AN_HOUR));
        assertThat(duration.inSeconds(), is(duration.inMinutes() * SECONDS_IN_A_MINUTE));
        assertThat(duration.inMillis(), is(duration.inSeconds() * MILLIS_IN_A_SECOND));
    }

    @Test
    public void canAddDurations() {
        assertThat(days(1).plus(days(1)), is(equalTo(days(2))));
View Full Code Here

Examples of com.volantis.shared.time.Period.inSeconds()

               
                // According to HTTp specification we treat "never expires" as "expires in approx. 1 year.
                // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21
                final long ttl = ((Period.INDEFINITELY.equals(timeToLive))) ?
                        365 * 24 * 60 * 60 :
                        timeToLive.inSeconds() + SAFETY_THRESHOLD_FOR_MAP_ITEMS;

                mediaAgent.ensureMinTimeToLive(ttl);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.