@Test(groups = TestGroup.UNIT)
public class DepGraphBasicTest extends AbstractDependencyGraphBuilderTest {
public void singleOutputSingleFunctionNode() {
DepGraphTestHelper helper = helper();
MockFunction function = helper.addFunctionProducing1and2();
DependencyGraphBuilder builder = helper.createBuilder(null);
builder.addTarget(Sets.newHashSet(helper.getRequirement1()));
DependencyGraph graph = builder.getDependencyGraph();
assertNotNull(graph);
assertTrue(graph.getOutputSpecifications().contains(helper.getSpec1()));
assertTrue(graph.getOutputSpecifications().contains(helper.getSpec2()));
Collection<DependencyNode> nodes = graph.getDependencyNodes();
assertNotNull(nodes);
assertEquals(1, nodes.size());
DependencyNode node = nodes.iterator().next();
assertEquals(function, node.getFunction().getFunction());
assertEquals(function.getDefaultParameters(), node.getFunction().getParameters());
assertTrue(node.getOutputValues().contains(helper.getSpec1()));
assertTrue(node.getOutputValues().contains(helper.getSpec2()));
assertTrue(node.getInputNodes().isEmpty());
assertEquals(helper.getTarget().toSpecification(), node.getComputationTarget());
graph.removeUnnecessaryValues();
nodes = graph.getDependencyNodes();
assertNotNull(nodes);
assertEquals(1, nodes.size());
node = nodes.iterator().next();
assertEquals(function, node.getFunction().getFunction());
assertEquals(function.getDefaultParameters(), node.getFunction().getParameters());
assertTrue(node.getOutputValues().contains(helper.getSpec1()));
assertFalse(node.getOutputValues().contains(helper.getSpec2()));
assertTrue(node.getInputNodes().isEmpty());
}