@Test public void renderAllPlaceholdersCombined() { UptimeToken token = new UptimeToken("d:HH:mm:ss.SSS"); Duration duration = Duration.ZERO; assertThat(render(token, duration)).isEqualTo("0:00:00:00.000"); duration = Duration.ofDays(1).plusHours(12).plusMinutes(30).plusSeconds(55); assertThat(render(token, duration)).isEqualTo("1:12:30:55.000"); duration = Duration.ofDays(90).plusHours(23).plusMinutes(59).plusSeconds(59).plusNanos(999_999_999); assertThat(render(token, duration)).isEqualTo("90:23:59:59.999"); }
@Override public void render(final LogEntry logEntry, final StringBuilder builder) { long nanoseconds = logEntry.getTimestamp().calcDifferenceInNanoseconds(RuntimeProvider.getStartTime()); format(builder, nanoseconds); }
UptimeToken implements Token { @Override public void render(final LogEntry logEntry, final StringBuilder builder) { long nanoseconds = logEntry.getTimestamp().calcDifferenceInNanoseconds(RuntimeProvider.getStartTime()); format(builder, nanoseconds); } }
UptimeToken implements Token { @Override public void render(final LogEntry logEntry, final StringBuilder builder) { long nanoseconds = logEntry.getTimestamp().calcDifferenceInNanoseconds(RuntimeProvider.getStartTime()); format(builder, nanoseconds); } UptimeToken();   UptimeToken(final String pattern); }
UptimeToken implements Token { @Override public void render(final LogEntry logEntry, final StringBuilder builder) { long nanoseconds = logEntry.getTimestamp().calcDifferenceInNanoseconds(RuntimeProvider.getStartTime()); format(builder, nanoseconds); } UptimeToken();   UptimeToken(final String pattern); @Override Collection<LogEntryValue> getRequiredLogEntryValues(); @Override void render(final LogEntry logEntry, final StringBuilder builder); @Override void apply(final LogEntry logEntry, final PreparedStatement statement, final int index); }
UptimeToken implements Token { @Override public void render(final LogEntry logEntry, final StringBuilder builder) { long nanoseconds = logEntry.getTimestamp().calcDifferenceInNanoseconds(RuntimeProvider.getStartTime()); format(builder, nanoseconds); } UptimeToken();   UptimeToken(final String pattern); @Override Collection<LogEntryValue> getRequiredLogEntryValues(); @Override void render(final LogEntry logEntry, final StringBuilder builder); @Override void apply(final LogEntry logEntry, final PreparedStatement statement, final int index);  }