org.evolizer.famix.model.entities.FamixClass planetClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.Planet", null);
Assert.assertTrue("Graph must contain FAMIX entity " + planetClass.getUniqueName(), graph.contains(planetClass));
org.evolizer.famix.model.entities.FamixMethod planetContstructor = new org.evolizer.famix.model.entities.FamixMethod("thebigvoid.Planet.<init>(java.lang.String,java.awt.Color)", null);
Assert.assertTrue("Graph must contain FAMIX entity " + planetContstructor.getUniqueName(), graph.contains(planetContstructor));
Node thebigvoidPackageNode = graph.getNode(thebigvoidPackage);
Node planetClassNode = graph.getNode(planetClass);
// Node planetConstructorNode = graph.getNode(planetContstructor);
Assert.assertEquals(thebigvoidPackageNode + " node should have 1 child nodes before adding the associations", 1, graph.getHierarchyManager().getChildren(thebigvoidPackageNode).size());
AbstractGraphEditCommand command = new AddEntitiesViaOutDependenciesCommand(
planetClassNode,
fGraphPanel.getGraphLoader(),
fGraphPanel.getEdgeGrouper(),
null);
command.execute();
org.evolizer.famix.model.entities.FamixClass stellarObjectClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.StellarObject", null);
Assert.assertTrue("Graph must contain FAMIX entity " + stellarObjectClass.getUniqueName(), graph.contains(stellarObjectClass));
org.evolizer.famix.model.entities.FamixAttribute stellarObjectName = new org.evolizer.famix.model.entities.FamixAttribute("thebigvoid.StellarObject.name", null);
Assert.assertTrue("Graph must contain FAMIX entity " + stellarObjectName.getUniqueName(), graph.contains(stellarObjectName));
Node stellarObjectClassNode = graph.getNode(stellarObjectClass);
Node stellarObjectNameNode = graph.getNode(stellarObjectName);
Assert.assertEquals("Parent node of " + stellarObjectClassNode + " has to be " + thebigvoidPackageNode, thebigvoidPackageNode, graph.getHierarchyManager().getParentNode(stellarObjectClassNode));
Assert.assertEquals("Parent node of " + stellarObjectNameNode + " has to be " + stellarObjectClassNode, stellarObjectClassNode, graph.getHierarchyManager().getParentNode(stellarObjectNameNode));
Assert.assertEquals(thebigvoidPackageNode + " node should have 2 child nodes after adding the associations", 2, graph.getHierarchyManager().getChildren(thebigvoidPackageNode).size());
Assert.assertEquals(stellarObjectClassNode + " node should have only 1 child node", 1, graph.getHierarchyManager().getChildren(stellarObjectClassNode).size());