showClassPlanet();
IEvolizerSession session = EvolizerSessionHandler.getHandler().getCurrentSession(project.getProject());
List<AbstractFamixEntity> queryResult = session.query("from FamixClass as c where c.uniqueName = 'thebigvoid.Galaxy'", AbstractFamixEntity.class, 1);
AbstractGraphEditCommand command = new AddEntitiesCommand(
queryResult,
fGraphPanel.getGraphLoader(),
fGraphPanel.getEdgeGrouper());
command.execute();
DependencyGraph graph = fGraphPanel.getGraph();
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.FamixClass galaxyClass = new org.evolizer.famix.model.entities.FamixClass("thebigvoid.Galaxy", null);
Assert.assertTrue("Graph must contain FAMIX entity " + galaxyClass.getUniqueName(), graph.contains(galaxyClass));
org.evolizer.famix.model.entities.FamixMethod galaxyContstructor = new org.evolizer.famix.model.entities.FamixMethod("thebigvoid.Galaxy.<init>(java.lang.String)", null);
Assert.assertTrue("Graph must contain FAMIX entity " + galaxyContstructor.getUniqueName(), graph.contains(galaxyContstructor));
Assert.assertTrue("Command should add entities", command.getEditedEntities().size() > 0);
Assert.assertTrue("Command should add associations", command.getEditedAssociations().size() > 0);
Assert.assertTrue("Command should add class " + galaxyClass, command.getEditedEntities().contains(galaxyClass));
Assert.assertTrue("Command should add method " + galaxyContstructor, command.getEditedEntities().contains(galaxyContstructor));
Node planetClassNode = graph.getNode(planetClass);
Node galaxyClassNode = graph.getNode(galaxyClass);
Node galaxyConstructorNode = graph.getNode(galaxyContstructor);
Assert.assertEquals("Parent node of " + galaxyConstructorNode + " has to be " + galaxyClassNode, galaxyClassNode, graph.getHierarchyManager().getParentNode(galaxyConstructorNode));