@Test public void getRevision() throws Exception { if (!haveSccs) { System.out.println("sccs not available. Skipping test"); return; } ZipInputStream zstream = new ZipInputStream(getClass().getResourceAsStream("/history/sccs-revisions.zip")); ZipEntry entry; while ((entry = zstream.getNextEntry()) != null) { String expected = readInput(zstream); InputStream sccs = SCCSget.getRevision("sccs",sccsfile, entry.getName()); String got = readInput(sccs); sccs.close(); zstream.closeEntry(); assertEquals(expected, got); } zstream.close(); }
public static InputStream getRevision(String command, File file, String revision) throws IOException { InputStream ret = null; ArrayList<String> argv = new ArrayList<>(); argv.add(command); argv.add("get"); argv.add("-p"); if (revision != null) { argv.add("-r" + revision); } argv.add(file.getCanonicalPath()); Executor executor = new Executor(argv); if (executor.exec() == 0) { ret = executor.getOutputStream(); } return ret; }
SCCSget { public static InputStream getRevision(String command, File file, String revision) throws IOException { InputStream ret = null; ArrayList<String> argv = new ArrayList<>(); argv.add(command); argv.add("get"); argv.add("-p"); if (revision != null) { argv.add("-r" + revision); } argv.add(file.getCanonicalPath()); Executor executor = new Executor(argv); if (executor.exec() == 0) { ret = executor.getOutputStream(); } return ret; } }
SCCSget { public static InputStream getRevision(String command, File file, String revision) throws IOException { InputStream ret = null; ArrayList<String> argv = new ArrayList<>(); argv.add(command); argv.add("get"); argv.add("-p"); if (revision != null) { argv.add("-r" + revision); } argv.add(file.getCanonicalPath()); Executor executor = new Executor(argv); if (executor.exec() == 0) { ret = executor.getOutputStream(); } return ret; } private  SCCSget(); }
SCCSget { public static InputStream getRevision(String command, File file, String revision) throws IOException { InputStream ret = null; ArrayList<String> argv = new ArrayList<>(); argv.add(command); argv.add("get"); argv.add("-p"); if (revision != null) { argv.add("-r" + revision); } argv.add(file.getCanonicalPath()); Executor executor = new Executor(argv); if (executor.exec() == 0) { ret = executor.getOutputStream(); } return ret; } private  SCCSget(); static InputStream getRevision(String command, File file, String revision); }
SCCSget { public static InputStream getRevision(String command, File file, String revision) throws IOException { InputStream ret = null; ArrayList<String> argv = new ArrayList<>(); argv.add(command); argv.add("get"); argv.add("-p"); if (revision != null) { argv.add("-r" + revision); } argv.add(file.getCanonicalPath()); Executor executor = new Executor(argv); if (executor.exec() == 0) { ret = executor.getOutputStream(); } return ret; } private  SCCSget(); static InputStream getRevision(String command, File file, String revision);  }