@Test public void printVersion() throws UnsupportedEncodingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(64); PrintStream ps = new PrintStream(baos, true); new HarReplayMain().printVersion(ps); ps.flush(); String actual = baos.toString(UTF_8.name()); System.out.print(actual); assertFalse("actual version string", actual.contains(HarReplayMain.DEFAULT_VERSION)); }
@SuppressWarnings("SameParameterValue") protected void printVersion(PrintStream out) { Properties p = loadMavenProperties(); String name = p.getProperty("project.parent.name", "har-replay"); String version = p.getProperty("project.version", DEFAULT_VERSION); URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); out.format("%s %s (in %s)%n", name, version, location); }
HarReplayMain { @SuppressWarnings("SameParameterValue") protected void printVersion(PrintStream out) { Properties p = loadMavenProperties(); String name = p.getProperty("project.parent.name", "har-replay"); String version = p.getProperty("project.version", DEFAULT_VERSION); URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); out.format("%s %s (in %s)%n", name, version, location); } }
HarReplayMain { @SuppressWarnings("SameParameterValue") protected void printVersion(PrintStream out) { Properties p = loadMavenProperties(); String name = p.getProperty("project.parent.name", "har-replay"); String version = p.getProperty("project.version", DEFAULT_VERSION); URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); out.format("%s %s (in %s)%n", name, version, location); } HarReplayMain(); @VisibleForTesting  HarReplayMain(OptionParser parser); }
HarReplayMain { @SuppressWarnings("SameParameterValue") protected void printVersion(PrintStream out) { Properties p = loadMavenProperties(); String name = p.getProperty("project.parent.name", "har-replay"); String version = p.getProperty("project.version", DEFAULT_VERSION); URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); out.format("%s %s (in %s)%n", name, version, location); } HarReplayMain(); @VisibleForTesting  HarReplayMain(OptionParser parser); static void main(String[] args); }
HarReplayMain { @SuppressWarnings("SameParameterValue") protected void printVersion(PrintStream out) { Properties p = loadMavenProperties(); String name = p.getProperty("project.parent.name", "har-replay"); String version = p.getProperty("project.version", DEFAULT_VERSION); URL location = getClass().getProtectionDomain().getCodeSource().getLocation(); out.format("%s %s (in %s)%n", name, version, location); } HarReplayMain(); @VisibleForTesting  HarReplayMain(OptionParser parser); static void main(String[] args);  }