@Test(description = "Test add command") public void testAddCommand() throws IOException { String[] args = {"mainmodule"}; AddCommand addCommand = new AddCommand(projectPath, printStream); new CommandLine(addCommand).parseArgs(args); addCommand.execute(); Path moduleDir = srcPath.resolve("mainmodule"); Assert.assertTrue(Files.exists(moduleDir)); Assert.assertTrue(Files.isDirectory(moduleDir)); Assert.assertTrue(Files.exists(moduleDir.resolve("Module.md"))); Assert.assertTrue(Files.exists(moduleDir.resolve("main.bal"))); Assert.assertTrue(Files.exists(moduleDir.resolve("resources"))); Assert.assertTrue(Files.isDirectory(moduleDir.resolve("resources"))); Path moduleTests = moduleDir.resolve("tests"); Assert.assertTrue(Files.exists(moduleTests)); Assert.assertTrue(Files.isDirectory(moduleTests)); Assert.assertTrue(Files.exists(moduleTests.resolve("main_test.bal"))); Assert.assertTrue(Files.exists(moduleTests.resolve("resources"))); Assert.assertTrue(Files.isDirectory(moduleTests.resolve("resources"))); Assert.assertTrue(readOutput().contains("Added new ballerina module")); }
public AddCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; homeCache = RepoUtils.createAndGetHomeReposPath(); initJarFs(); }
AddCommand implements BLauncherCmd { public AddCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; homeCache = RepoUtils.createAndGetHomeReposPath(); initJarFs(); } }
AddCommand implements BLauncherCmd { public AddCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; homeCache = RepoUtils.createAndGetHomeReposPath(); initJarFs(); } AddCommand();  AddCommand(Path userDir, PrintStream errStream);  AddCommand(Path userDir, PrintStream errStream, Path homeCache); }
AddCommand implements BLauncherCmd { public AddCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; homeCache = RepoUtils.createAndGetHomeReposPath(); initJarFs(); } AddCommand();  AddCommand(Path userDir, PrintStream errStream);  AddCommand(Path userDir, PrintStream errStream, Path homeCache); @Override void execute(); @Override String getName(); @Override void printLongDesc(StringBuilder out); @Override void printUsage(StringBuilder out); @Override void setParentCmdParser(CommandLine parentCmdParser); }
AddCommand implements BLauncherCmd { public AddCommand() { userDir = Paths.get(System.getProperty("user.dir")); errStream = System.err; homeCache = RepoUtils.createAndGetHomeReposPath(); initJarFs(); } AddCommand();  AddCommand(Path userDir, PrintStream errStream);  AddCommand(Path userDir, PrintStream errStream, Path homeCache); @Override void execute(); @Override String getName(); @Override void printLongDesc(StringBuilder out); @Override void printUsage(StringBuilder out); @Override void setParentCmdParser(CommandLine parentCmdParser);  }