@Test public void testWrapper() throws Exception { File testFolder = new File(".test-files/testWrapper"); File redistFolder = new File(testFolder, "redist"); File workingFolder = new File(testFolder, "working"); File cdepFile = new File(redistFolder, "cdep"); File cdepBatFile = new File(redistFolder, "cdep.bat"); File cdepYmlFile = new File(redistFolder, "cdep.yml"); File bootstrapJar = new File(redistFolder, "bootstrap/wrapper/bootstrap.jar"); redistFolder.mkdirs(); workingFolder.mkdirs(); bootstrapJar.getParentFile().mkdirs(); Files.write("cdepFile content", cdepFile, Charset.defaultCharset()); Files.write("cdepBatFile content", cdepBatFile, Charset.defaultCharset()); Files.write("cdepYmlFile content", cdepYmlFile, Charset.defaultCharset()); Files.write("bootstrapJar content", bootstrapJar, Charset.defaultCharset()); System.setProperty("io.cdep.appname", new File(redistFolder, "cdep.bat").getAbsolutePath()); String result; try { result = main("wrapper", "-wf", workingFolder.toString()); } finally { System.setProperty("io.cdep.appname", "rando-test-folder"); } System.out.print(result); assertThat(result).contains("Installing cdep"); File cdepToFile = new File(workingFolder, "cdep"); File cdepBatToFile = new File(workingFolder, "cdep.bat"); File cdepYmlToFile = new File(workingFolder, "cdep.yml"); File bootstrapJarToFile = new File(workingFolder, "bootstrap/wrapper/bootstrap.jar"); assertThat(cdepToFile.isFile()).isTrue(); assertThat(cdepBatToFile.isFile()).isTrue(); assertThat(cdepYmlToFile.isFile()).isTrue(); assertThat(bootstrapJarToFile.isFile()).isTrue(); }
public static void main(@NotNull String[] args) { try { new CDep(AnsiConsole.out, AnsiConsole.err, true).go(args, false); } catch (Throwable e) { e.printStackTrace(); System.exit(Integer.MIN_VALUE); } finally { AnsiConsole.out.close(); AnsiConsole.err.close(); } }
CDep { public static void main(@NotNull String[] args) { try { new CDep(AnsiConsole.out, AnsiConsole.err, true).go(args, false); } catch (Throwable e) { e.printStackTrace(); System.exit(Integer.MIN_VALUE); } finally { AnsiConsole.out.close(); AnsiConsole.err.close(); } } }
CDep { public static void main(@NotNull String[] args) { try { new CDep(AnsiConsole.out, AnsiConsole.err, true).go(args, false); } catch (Throwable e) { e.printStackTrace(); System.exit(Integer.MIN_VALUE); } finally { AnsiConsole.out.close(); AnsiConsole.err.close(); } } CDep(@NotNull PrintStream out, @NotNull PrintStream err, boolean ansi); }
CDep { public static void main(@NotNull String[] args) { try { new CDep(AnsiConsole.out, AnsiConsole.err, true).go(args, false); } catch (Throwable e) { e.printStackTrace(); System.exit(Integer.MIN_VALUE); } finally { AnsiConsole.out.close(); AnsiConsole.err.close(); } } CDep(@NotNull PrintStream out, @NotNull PrintStream err, boolean ansi); static void main(@NotNull String[] args); }
CDep { public static void main(@NotNull String[] args) { try { new CDep(AnsiConsole.out, AnsiConsole.err, true).go(args, false); } catch (Throwable e) { e.printStackTrace(); System.exit(Integer.MIN_VALUE); } finally { AnsiConsole.out.close(); AnsiConsole.err.close(); } } CDep(@NotNull PrintStream out, @NotNull PrintStream err, boolean ansi); static void main(@NotNull String[] args);  }