private void saveProps(Properties p) { try { FileUtils.savePropertiesToFile(p, STATE_FILE.getPath()); } catch (Exception e) { throw new RuntimeException(e); } }
private Properties loadProps() { try { Properties p = FileUtils.loadPropertiesFromFile(STATE_FILE.getPath()); return p; } catch (Exception e) { throw new RuntimeException(e); } }
private static File createDefaultSUT() throws Exception { File sutDirectory = new File(JSystemProperties.getCurrentTestsPath(), "sut"); JSystemProperties.getInstance().setPreference(FrameworkOptions.USED_SUT_FILE, "default.xml"); File defaultSut = new File(sutDirectory, "default.xml"); if (!defaultSut.exists()) { FileUtils.write(defaultSut, "<sut/>", false); } return defaultSut; }
public void doToFile(NameGenerator generator) throws IOException { if (isTreeRoot) { StringBuffer buffer = new StringBuffer(); buffer.append( "<HEAD>\n" + "<LINK REL=\"stylesheet\" HREF=\"" + FileUtils.getFileNameWithoutFullPath( JSystemProperties.getInstance() .getPreferenceOrDefault(FrameworkOptions.HTML_CSS_PATH)) + "\">\n"); if (isTreeRoot) { buffer.append( "<SCRIPT SRC=\"mktree.js\" LANGUAGE=\"JavaScript\"></SCRIPT>\n" + "<LINK REL=\"stylesheet\" HREF=\"mktree.css\">\n"); } buffer.append("</HEAD>\n"); buffer.append("<BODY class=\"" + getCssClassCanonicalValue() + "\">"); buffer.append(getTreeSons(null)); buffer.append("</BODY>"); writeBufferToFile(buffer); } updateParents(generator); }