String query = "a = load 'input.txt'; b = load 'anotherinput.txt'; c = join a by $0, b by $1;" +
"store c into 'output' using org.apache.pig.test.PigStorageWithSchema();";
// Set batch on so the query is not executed
pigServer.setBatchOn();
pigServer.registerQuery(query);
LogicalPlanData lData = pigServer.getLogicalPlanData();
assertEquals("LoadFunc must be PigStorage", "org.apache.pig.builtin.PigStorage", lData.getLoadFuncs().get(0));
assertEquals("StoreFunc must be PigStorageWithSchema", "org.apache.pig.test.PigStorageWithSchema", lData.getStoreFuncs().get(0));
assertEquals("Number of sources must be 2", lData.getNumSources(), 2);
assertEquals("Number of sinks must be 1", lData.getNumSinks(), 1);
assertTrue("Source must end with input.txt", lData.getSources().get(0).endsWith("input.txt"));
assertTrue("Sink must end with output", lData.getSinks().get(0).endsWith("output"));
assertEquals("Number of logical relational operators must be 4", lData.getNumLogicalRelationOperators(), 4);
}