@Test(description = "Initialize a new empty project") public void testNewCommand() throws IOException { String[] args = {"project-name"}; NewCommand newCommand = new NewCommand(tmpDir, printStream); new CommandLine(newCommand).parse(args); newCommand.execute(); Path projectPath = tmpDir.resolve("project-name"); Assert.assertTrue(Files.exists(projectPath)); Assert.assertTrue(Files.exists(projectPath.resolve("Ballerina.toml"))); Assert.assertTrue(Files.exists(projectPath.resolve("src"))); Assert.assertTrue(Files.isDirectory(projectPath.resolve("src"))); Assert.assertTrue(Files.exists(projectPath.resolve(".gitignore"))); Assert.assertTrue(readOutput().contains("Created new Ballerina project at ")); }
public NewCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; }
NewCommand implements BLauncherCmd { public NewCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; } }
NewCommand implements BLauncherCmd { public NewCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; } NewCommand();  NewCommand(Path userDir, PrintStream errStream); }
NewCommand implements BLauncherCmd { public NewCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; } NewCommand();  NewCommand(Path userDir, PrintStream errStream); @Override void execute(); @Override String getName(); @Override void printLongDesc(StringBuilder out); @Override void printUsage(StringBuilder out); @Override void setParentCmdParser(CommandLine parentCmdParser); }
NewCommand implements BLauncherCmd { public NewCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; } NewCommand();  NewCommand(Path userDir, PrintStream errStream); @Override void execute(); @Override String getName(); @Override void printLongDesc(StringBuilder out); @Override void printUsage(StringBuilder out); @Override void setParentCmdParser(CommandLine parentCmdParser);  }