public class ScriptUtilTest {
@Test
public void getFileBytes() {
ScriptUtil scriptUtil = new ScriptUtil(null);
try {
String fileContents = "the rain in spain falls mainly on the plain";
String tempDir = System.getProperty("java.io.tmpdir");
File testFile = new File(tempDir, "getFileBytesTest.txt");
byte[] contentBytes = fileContents.getBytes();
FileOutputStream writer = new FileOutputStream(testFile);
writer.write(contentBytes);
writer.close();
System.out.println("Test data written to " + testFile.getAbsolutePath());
byte[] fileBytes = scriptUtil.getFileBytes(testFile.getAbsolutePath());
String results = new String(fileBytes);
System.out.println("Wrote: \"" + fileContents + "\"\nRead: \"" + results + "\"");
assert fileContents.equals(results) : "Wrote: \"" + fileContents + "\"\nRead: \"" + results + "\"";
} catch (IOException ioe) {