@Test public void testFormatElapasedTime() { final long start = 1392882; final long time1 = 138; final long time2 = 1848; final long time3 = 50; final long time4 = 8; assertEquals("0.14 seconds", sut.formatElapasedTime(start, start + time1)); assertEquals("1.85 seconds", sut.formatElapasedTime(start, start + time2)); assertEquals("0.05 seconds", sut.formatElapasedTime(start, start + time3)); assertEquals("0.01 seconds", sut.formatElapasedTime(start, start + time4)); }
protected String formatElapasedTime(final long startTime, final long endTime) { final int millisecondsPerSecond = 1000; String elapsedTime = String.format("%1$.2f seconds", (endTime - startTime) / (float) millisecondsPerSecond); if (elapsedTime == "0.00 seconds") { elapsedTime = "0.01 seconds"; } return elapsedTime; }
GetDirectorySearchResultsExecution implements ExecutionStrategy<ServiceActionContext> { protected String formatElapasedTime(final long startTime, final long endTime) { final int millisecondsPerSecond = 1000; String elapsedTime = String.format("%1$.2f seconds", (endTime - startTime) / (float) millisecondsPerSecond); if (elapsedTime == "0.00 seconds") { elapsedTime = "0.01 seconds"; } return elapsedTime; } }
GetDirectorySearchResultsExecution implements ExecutionStrategy<ServiceActionContext> { protected String formatElapasedTime(final long startTime, final long endTime) { final int millisecondsPerSecond = 1000; String elapsedTime = String.format("%1$.2f seconds", (endTime - startTime) / (float) millisecondsPerSecond); if (elapsedTime == "0.00 seconds") { elapsedTime = "0.01 seconds"; } return elapsedTime; } GetDirectorySearchResultsExecution(final DirectorySearchLuceneQueryBuilder inQueryBuilder,
            final ProjectionSearchRequestBuilder inSearchRequestBuilder,
            final TransientPropertyPopulator inTransientPropertyPopulator); }
GetDirectorySearchResultsExecution implements ExecutionStrategy<ServiceActionContext> { protected String formatElapasedTime(final long startTime, final long endTime) { final int millisecondsPerSecond = 1000; String elapsedTime = String.format("%1$.2f seconds", (endTime - startTime) / (float) millisecondsPerSecond); if (elapsedTime == "0.00 seconds") { elapsedTime = "0.01 seconds"; } return elapsedTime; } GetDirectorySearchResultsExecution(final DirectorySearchLuceneQueryBuilder inQueryBuilder,
            final ProjectionSearchRequestBuilder inSearchRequestBuilder,
            final TransientPropertyPopulator inTransientPropertyPopulator); @SuppressWarnings("unchecked") @Override PagedSet<ModelView> execute(final ServiceActionContext inActionContext); }
GetDirectorySearchResultsExecution implements ExecutionStrategy<ServiceActionContext> { protected String formatElapasedTime(final long startTime, final long endTime) { final int millisecondsPerSecond = 1000; String elapsedTime = String.format("%1$.2f seconds", (endTime - startTime) / (float) millisecondsPerSecond); if (elapsedTime == "0.00 seconds") { elapsedTime = "0.01 seconds"; } return elapsedTime; } GetDirectorySearchResultsExecution(final DirectorySearchLuceneQueryBuilder inQueryBuilder,
            final ProjectionSearchRequestBuilder inSearchRequestBuilder,
            final TransientPropertyPopulator inTransientPropertyPopulator); @SuppressWarnings("unchecked") @Override PagedSet<ModelView> execute(final ServiceActionContext inActionContext);  }