Examples of duration()


Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("1 year, 1 month", timeUtils.duration(365 + 30));
    assertEquals("1 year, 1 month", timeUtils.duration(365 + 44));
    assertEquals("1 year, 2 months", timeUtils.duration(365 + 45));
    assertEquals("1 year, 2 months", timeUtils.duration(365 + 60));

    assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
View Full Code Here

Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("1 year, 1 month", timeUtils.duration(365 + 44));
    assertEquals("1 year, 2 months", timeUtils.duration(365 + 45));
    assertEquals("1 year, 2 months", timeUtils.duration(365 + 60));

    assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
View Full Code Here

Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("1 year, 2 months", timeUtils.duration(365 + 45));
    assertEquals("1 year, 2 months", timeUtils.duration(365 + 60));

    assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
  }
View Full Code Here

Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("1 year, 2 months", timeUtils.duration(365 + 60));

    assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
  }

View Full Code Here

Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
  }

  @Test
View Full Code Here

Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("2 years", timeUtils.duration(2 * 365 + 0));
    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
  }

  @Test
  public void testTimeAgo() throws Exception {
View Full Code Here

Examples of com.gitblit.utils.TimeUtils.duration()

    assertEquals("2 years", timeUtils.duration(2 * 365 + 10));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 15));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 30));
    assertEquals("2 years, 1 month", timeUtils.duration(2 * 365 + 44));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 45));
    assertEquals("2 years, 2 months", timeUtils.duration(2 * 365 + 60));
  }

  @Test
  public void testTimeAgo() throws Exception {
    // standard time ago tests
View Full Code Here

Examples of com.googlecode.jslint4java.JSLintResult.ResultBuilder.duration()

    @NeedsContext
    private JSLintResult buildResults(final String systemId, final long startNanos, final long endNanos) {
        return (JSLintResult) contextFactory.call(new ContextAction() {
            public Object run(Context cx) {
                ResultBuilder b = new JSLintResult.ResultBuilder(systemId);
                b.duration(TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos));
                for (Issue issue : readErrors(systemId)) {
                    b.addIssue(issue);
                }

                // Collect a report on what we've just linted.
View Full Code Here

Examples of io.crate.action.sql.SQLResponse.duration()

                new Object[] {"row2_col1", "row2_col2"},
        }));

        assertThat(resp.columnTypes(), is(new DataType[] { DataTypes.STRING, DataTypes.STRING }));
        assertThat(resp.rowCount(), is(2L));
        assertThat(resp.duration(), is(-1L));
    }
}
View Full Code Here

Examples of org.apache.pig.builtin.MonitoredUDF.duration()

        // is 10 enough? This is pretty arbitrary.
        exec = MoreExecutors.getExitingExecutorService(new ScheduledThreadPoolExecutor(10));
        this.evalFunc = udf;
        MonitoredUDF anno = udf.getClass().getAnnotation(MonitoredUDF.class);
        timeUnit = anno.timeUnit();
        duration = anno.duration();
        errorCallback = anno.errorCallback();

        // The exceptions really should not happen since our handlers are defined by the parent class which
        // must be extended by all custom handlers.
        try {
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.