@Ignore("not yet ready , Please ignore.") @Test public void terraformCommandLineDecoratorDoesntBlowUpWithoutLogging() throws IOException, InterruptedException { Path tfPath = Paths.get(".tf"); File fetchFile = new File(String.format("..%stf-maven-plugin%ssrc%smain%sresources%stf",File.separator,File.separator,File.separator,File.separator,File.separator)); File tfDir = tfPath.toFile(); String[] tfwFileNames = {"tfw", "tfw.cmd", "tfw.ps1", "terraform-maven.properties"}; if (!tfDir.exists()) { try { tfDir.mkdir(); } catch (Exception e) { System.out.printf("Unable to create .tf directory\n"); } } for (String tfwFileName : tfwFileNames) { String tfwFile = (fetchFile.toPath().toFile() + File.separator + tfwFileName); String tfwFileDestName = (".tf" + File.separator + tfwFileName); File tfwFileSource = new File(tfwFile); File tfwFileDest = new File(tfwFileDestName); if (!tfwFileDest.exists()) { Files.copy(tfwFileSource.toPath(), tfwFileDest.toPath()); tfwFileDest.setExecutable(true,false); } } TerraformCommandLineDecorator terraformCommandLineDecorator = new TerraformCommandLineDecorator(TerraformCommand.VERSION); terraformCommandLineDecorator.execute("init"); String[]entries = tfDir.list(); for (String s: entries) { File currentFile = new File(tfDir.getPath(), s); currentFile.delete(); } tfDir.delete(); }
@Override public String execute(String command, int timeout) throws IOException, InterruptedException { return commandLine.execute(getTerraformCommand(command), timeout); }
TerraformCommandLineDecorator implements Executable { @Override public String execute(String command, int timeout) throws IOException, InterruptedException { return commandLine.execute(getTerraformCommand(command), timeout); } }
TerraformCommandLineDecorator implements Executable { @Override public String execute(String command, int timeout) throws IOException, InterruptedException { return commandLine.execute(getTerraformCommand(command), timeout); } TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine, Logger logger);  TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine);  TerraformCommandLineDecorator(TerraformCommand cmd, Logger logger);  TerraformCommandLineDecorator(TerraformCommand cmd);  TerraformCommandLineDecorator(TerraformCommand cmd, String tfRootDir); }
TerraformCommandLineDecorator implements Executable { @Override public String execute(String command, int timeout) throws IOException, InterruptedException { return commandLine.execute(getTerraformCommand(command), timeout); } TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine, Logger logger);  TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine);  TerraformCommandLineDecorator(TerraformCommand cmd, Logger logger);  TerraformCommandLineDecorator(TerraformCommand cmd);  TerraformCommandLineDecorator(TerraformCommand cmd, String tfRootDir); @Override String execute(String command, int timeout); @Override String execute(String command); @Override void setLogger(Logger logger); Executable getCommandLine(); }
TerraformCommandLineDecorator implements Executable { @Override public String execute(String command, int timeout) throws IOException, InterruptedException { return commandLine.execute(getTerraformCommand(command), timeout); } TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine, Logger logger);  TerraformCommandLineDecorator(TerraformCommand cmd, Executable commandLine);  TerraformCommandLineDecorator(TerraformCommand cmd, Logger logger);  TerraformCommandLineDecorator(TerraformCommand cmd);  TerraformCommandLineDecorator(TerraformCommand cmd, String tfRootDir); @Override String execute(String command, int timeout); @Override String execute(String command); @Override void setLogger(Logger logger); Executable getCommandLine();  }