@Test public void wrapNumberContentWithLongSize() { Result result = mockResult( asList( "c1"), 345, 12, 978623, 132456798, 9223372036854775807L ); result = mockResult( asList( "c1"), 345, 12, 978623, 132456798, 9223372036854775807L ); ToStringLinePrinter printer = new ToStringLinePrinter(); new TableOutputFormatter(true, 2).formatAndCount(new ListBoltResult(result.list(), result.consume()), printer); String table = printer.result(); assertThat(table, is(String.join(NEWLINE, "+---------------------+", "| c1 |", "+---------------------+", "| 345 |", "| 12 |", "| 978623 |", "| 132456798 |", "| 9223372036854775807 |", "+---------------------+", NEWLINE))); }
@Override public int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output) { String[] columns = result.getKeys().toArray(new String[0]); if (columns.length == 0) { return 0; } Iterator<Record> records = result.iterate(); return formatResultAndCountRows(columns, records, output); }
TableOutputFormatter implements OutputFormatter { @Override public int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output) { String[] columns = result.getKeys().toArray(new String[0]); if (columns.length == 0) { return 0; } Iterator<Record> records = result.iterate(); return formatResultAndCountRows(columns, records, output); } }
TableOutputFormatter implements OutputFormatter { @Override public int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output) { String[] columns = result.getKeys().toArray(new String[0]); if (columns.length == 0) { return 0; } Iterator<Record> records = result.iterate(); return formatResultAndCountRows(columns, records, output); } TableOutputFormatter(boolean wrap, int numSampleRows); }
TableOutputFormatter implements OutputFormatter { @Override public int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output) { String[] columns = result.getKeys().toArray(new String[0]); if (columns.length == 0) { return 0; } Iterator<Record> records = result.iterate(); return formatResultAndCountRows(columns, records, output); } TableOutputFormatter(boolean wrap, int numSampleRows); @Override int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output); @Override @Nonnull String formatFooter(@Nonnull BoltResult result, int numberOfRows); @Override @Nonnull String formatInfo(@Nonnull ResultSummary summary); @Override @Nonnull String formatPlan(@Nullable ResultSummary summary); @Override Set<Capabilities> capabilities(); }
TableOutputFormatter implements OutputFormatter { @Override public int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output) { String[] columns = result.getKeys().toArray(new String[0]); if (columns.length == 0) { return 0; } Iterator<Record> records = result.iterate(); return formatResultAndCountRows(columns, records, output); } TableOutputFormatter(boolean wrap, int numSampleRows); @Override int formatAndCount(@Nonnull BoltResult result, @Nonnull LinePrinter output); @Override @Nonnull String formatFooter(@Nonnull BoltResult result, int numberOfRows); @Override @Nonnull String formatInfo(@Nonnull ResultSummary summary); @Override @Nonnull String formatPlan(@Nullable ResultSummary summary); @Override Set<Capabilities> capabilities();  }