private void WhenBuildPropertiesIsCreated() { try { File buildPropertiesFile = new File(LocalMachine.home + "automate/deploy-tutor/build.properties"); if (buildPropertiesFile.exists()) { buildPropertiesFile.delete(); } BufferedWriter writer = new BufferedWriter(new FileWriter(buildPropertiesFile)); String buildProperties = "server=http://localhost:8080"; buildProperties += ("\nserver-dir=/itjava/delivery/" + tutorial.getReadableName()); buildProperties += ("\nserver-login="******"\ndefault-codebase=http://localhost:8080/itjava/delivery/" + tutorial.getReadableName()); writer.write(buildProperties); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } }
private void WhenCompiled() { String CompilePath = "generated/" + tutorial.getTutorialName() + ".java"; JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); int result = compiler.run(null, null, null, CompilePath); System.out.println("Compile result code = " + result); }
private void ThenBrdFilesAreStored() { String fileToCheck = LocalMachine.home + "generated/" + tutorial.getTutorialName() + ".brd"; File f = new File(fileToCheck); assertTrue(f.exists()); }