/**
*
*/
public class TestMapReduceJobHistoryUpdater extends TestCase {
public void testDagMerging() {
WorkflowDag dag1 = new WorkflowDag();
dag1.addEntry(getEntry("a", "b", "c"));
dag1.addEntry(getEntry("b", "d"));
WorkflowContext one = new WorkflowContext();
one.setWorkflowDag(dag1);
WorkflowDag dag2 = new WorkflowDag();
dag2.addEntry(getEntry("a", "d"));
dag2.addEntry(getEntry("c", "e"));
WorkflowContext two = new WorkflowContext();
two.setWorkflowDag(dag2);
WorkflowDag emptyDag = new WorkflowDag();
WorkflowContext three = new WorkflowContext();
three.setWorkflowDag(emptyDag);
WorkflowDag mergedDag = new WorkflowDag();
mergedDag.addEntry(getEntry("a", "b", "c", "d"));
mergedDag.addEntry(getEntry("b", "d"));
mergedDag.addEntry(getEntry("c", "e"));
assertEquals(mergedDag, MapReduceJobHistoryUpdater.constructMergedDag(one, two));
assertEquals(mergedDag, MapReduceJobHistoryUpdater.constructMergedDag(two, one));
// test blank dag