RevisionsCommand implements Command { private void info(RevisionsOptions options, Closer closer) throws IOException { VersionGarbageCollector gc = bootstrapVGC(options, closer); System.out.println("retrieving gc info"); VersionGCInfo info = gc.getInfo(options.getOlderThan(), SECONDS); System.out.printf(Locale.US, "%21s %s%n", "Last Successful Run:", info.lastSuccess > 0? fmtTimestamp(info.lastSuccess) : "<unknown>"); System.out.printf(Locale.US, "%21s %s%n", "Oldest Revision:", fmtTimestamp(info.oldestRevisionEstimate)); System.out.printf(Locale.US, "%21s %d%n", "Delete Candidates:", info.revisionsCandidateCount); System.out.printf(Locale.US, "%21s %d%n", "Collect Limit:", info.collectLimit); System.out.printf(Locale.US, "%21s %s%n", "Collect Interval:", fmtDuration(info.recommendedCleanupInterval)); System.out.printf(Locale.US, "%21s %s%n", "Collect Before:", fmtTimestamp(info.recommendedCleanupTimestamp)); System.out.printf(Locale.US, "%21s %d%n", "Iterations Estimate:", info.estimatedIterations); }  @Override void execute(String... args);  }
@Test public void info() throws Exception { ns.getVersionGarbageCollector().gc(1, TimeUnit.HOURS); ns.dispose(); String output = captureSystemOut(new RevisionsCmd("info")); assertTrue(output.contains("Last Successful Run")); }