LogicalPlanTester lpt = new LogicalPlanTester(pig.getPigContext());
lpt.buildPlan("a = load '" + inputFileName + "' as (c:chararray, " +
"i:int,d:double);");
LogicalPlan lp = lpt.buildPlan("store a into '" + outputFileName +
"' using PigStorage();");
InputOutputFileVisitor visitor = new InputOutputFileVisitor(lp,
new CompilationMessageCollector(), pig.getPigContext());
visitor.visit();
} catch (PlanValidationException pve){
// Since output file is present, validation should fail
// and throw this exception
assertEquals(6000,pve.getErrorCode());
assertEquals(PigException.REMOTE_ENVIRONMENT, pve.getErrorSource());