String keyword) throws Throwable {
String scriptFile = "myscript.pig";
try {
BufferedReader br = new BufferedReader(new StringReader(piglatin));
DryRunGruntParser parser = new DryRunGruntParser(br, scriptFile,
new PigContext(ExecType.LOCAL, new Properties()));
PrintWriter w = new PrintWriter(new FileWriter(scriptFile));
w.print(piglatin);
w.close();
parser.parseStopOnError();
Assert.fail("Expected exception isn't thrown");
} catch (Exception e) {
String msg = e.getMessage();
int pos = msg.indexOf(keyword);