// using params map
PigServer pig=new PigServer(ExecType.LOCAL);
Map<String,String> params=new HashMap<String, String>();
params.put("input", "test/org/apache/pig/test/data/passwd");
File scriptFile=Util.createFile(new String[]{"a = load '$input' using PigStorage(':');"});
pig.registerScript(scriptFile.getAbsolutePath(),params);
Iterator<Tuple> iter=pig.openIterator("a");
int index=0;
List<Tuple> expectedTuples=Util.readFile2TupleList("test/org/apache/pig/test/data/passwd", ":");
while(iter.hasNext()){
Tuple tuple=iter.next();