test_class.declarator: store = ConfigurationStore.get()
test_class.modifier: private
test_class.original_string: private ConfigurationStore store = ConfigurationStore.get();
test_class.type: ConfigurationStore
test_class.var_name: store
test_class.declarator: graph = EntityGraph.get()
test_class.modifier: private
test_class.original_string: private EntityGraph graph = EntityGraph.get();
test_class.type: EntityGraph
test_class.var_name: graph
test_class.file: common/src/test/java/org/apache/ivory/entity/v0/EntityGraphTest.java
test_class.identifier: EntityGraphTest
test_class.superclass: extends AbstractTestBase
test_case.body: @Test
      public void testOnAdd() throws Exception {
  
          Process process = new Process();
          process.setName("p1");
          Cluster cluster = new Cluster();
          cluster.setName("c1");
          cluster.setColo("1");
          Feed f1 = addInput(process, "f1", cluster);
          Feed f2 = addInput(process, "f2", cluster);
          Feed f3 = addOutput(process, "f3", cluster);
          Feed f4 = addOutput(process, "f4", cluster);
          org.apache.ivory.entity.v0.process.Cluster processCluster = new org.apache.ivory.entity.v0.process.Cluster();
          processCluster.setName("c1");
          process.setClusters(new org.apache.ivory.entity.v0.process.Clusters());
          process.getClusters().getClusters().add(processCluster);
  
          store.publish(EntityType.CLUSTER, cluster);
          store.publish(EntityType.FEED, f1);
          store.publish(EntityType.FEED, f2);
          store.publish(EntityType.FEED, f3);
          store.publish(EntityType.FEED, f4);
          store.publish(EntityType.PROCESS, process);
  
          Set<Entity> entities = graph.getDependents(process);
          Assert.assertEquals(entities.size(), 5);
          Assert.assertTrue(entities.contains(cluster));
          Assert.assertTrue(entities.contains(f1));
          Assert.assertTrue(entities.contains(f2));
          Assert.assertTrue(entities.contains(f3));
          Assert.assertTrue(entities.contains(f4));
  
          entities = graph.getDependents(f1);
          Assert.assertEquals(entities.size(), 2);
          Assert.assertTrue(entities.contains(process));
          Assert.assertTrue(entities.contains(cluster));
  
          entities = graph.getDependents(f2);
          Assert.assertEquals(entities.size(), 2);
          Assert.assertTrue(entities.contains(process));
          Assert.assertTrue(entities.contains(cluster));
  
          entities = graph.getDependents(f3);
          Assert.assertEquals(entities.size(), 2);
          Assert.assertTrue(entities.contains(process));
          Assert.assertTrue(entities.contains(cluster));
  
          entities = graph.getDependents(f4);
          Assert.assertEquals(entities.size(), 2);
          Assert.assertTrue(entities.contains(process));
          Assert.assertTrue(entities.contains(cluster));
  
          entities = graph.getDependents(cluster);
          Assert.assertEquals(entities.size(), 5);
          Assert.assertTrue(entities.contains(process));
          Assert.assertTrue(entities.contains(f1));
          Assert.assertTrue(entities.contains(f2));
          Assert.assertTrue(entities.contains(f3));
          Assert.assertTrue(entities.contains(f4));
      }
test_case.class_method_signature: EntityGraphTest.testOnAdd()
test_case.full_signature: @Test public void testOnAdd()
test_case.identifier: testOnAdd
test_case.invocations: setName setName setColo addInput addInput addOutput addOutput setName setClusters add getClusters getClusters publish publish publish publish publish publish getDependents assertEquals size assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains getDependents assertEquals size assertTrue contains assertTrue contains getDependents assertEquals size assertTrue contains assertTrue contains getDependents assertEquals size assertTrue contains assertTrue contains getDependents assertEquals size assertTrue contains assertTrue contains getDependents assertEquals size assertTrue contains assertTrue contains assertTrue contains assertTrue contains assertTrue contains
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOnAdd()
focal_class.declarator: LOG = Logger.getLogger(EntityGraph.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger LOG = Logger.getLogger(EntityGraph.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: instance = new EntityGraph()
focal_class.modifier: private static
focal_class.original_string: private static EntityGraph instance = new EntityGraph();
focal_class.type: EntityGraph
focal_class.var_name: instance
focal_class.declarator: graph = new ConcurrentHashMap<Node, Set<Node>>()
focal_class.modifier: private
focal_class.original_string: private Map<Node, Set<Node>> graph = new ConcurrentHashMap<Node, Set<Node>>();
focal_class.type: Map<Node, Set<Node>>
focal_class.var_name: graph
focal_class.file: common/src/main/java/org/apache/ivory/entity/v0/EntityGraph.java
focal_class.identifier: EntityGraph
focal_class.interfaces: implements ConfigurationChangeListener
focal_class.class_method_signature: EntityGraph.EntityGraph()
focal_class.full_signature: private  EntityGraph()
focal_class.identifier: EntityGraph
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  EntityGraph()
focal_class.class_method_signature: EntityGraph.get()
focal_class.full_signature: public static EntityGraph get()
focal_class.identifier: get
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: EntityGraph
focal_class.signature: EntityGraph get()
focal_class.class_method_signature: EntityGraph.getDependents(Entity entity)
focal_class.full_signature: public Set<Entity> getDependents(Entity entity)
focal_class.identifier: getDependents
focal_class.modifiers: public
focal_class.parameters: (Entity entity)
focal_class.return: Set<Entity>
focal_class.signature: Set<Entity> getDependents(Entity entity)
focal_class.class_method_signature: EntityGraph.onAdd(Entity entity)
focal_class.full_signature: @Override public void onAdd(Entity entity)
focal_class.identifier: onAdd
focal_class.modifiers: @Override public
focal_class.parameters: (Entity entity)
focal_class.return: void
focal_class.signature: void onAdd(Entity entity)
focal_class.class_method_signature: EntityGraph.onRemove(Entity entity)
focal_class.full_signature: @Override public void onRemove(Entity entity)
focal_class.identifier: onRemove
focal_class.modifiers: @Override public
focal_class.parameters: (Entity entity)
focal_class.return: void
focal_class.signature: void onRemove(Entity entity)
focal_class.class_method_signature: EntityGraph.onChange(Entity oldEntity, Entity newEntity)
focal_class.full_signature: @Override public void onChange(Entity oldEntity, Entity newEntity)
focal_class.identifier: onChange
focal_class.modifiers: @Override public
focal_class.parameters: (Entity oldEntity, Entity newEntity)
focal_class.return: void
focal_class.signature: void onChange(Entity oldEntity, Entity newEntity)
focal_class.class_method_signature: EntityGraph.getEdgesFor(Process process)
focal_class.full_signature: private Map<Node, Set<Node>> getEdgesFor(Process process)
focal_class.identifier: getEdgesFor
focal_class.modifiers: private
focal_class.parameters: (Process process)
focal_class.return: Map<Node, Set<Node>>
focal_class.signature: Map<Node, Set<Node>> getEdgesFor(Process process)
focal_class.class_method_signature: EntityGraph.getEdgesFor(Feed feed)
focal_class.full_signature: private Map<Node, Set<Node>> getEdgesFor(Feed feed)
focal_class.identifier: getEdgesFor
focal_class.modifiers: private
focal_class.parameters: (Feed feed)
focal_class.return: Map<Node, Set<Node>>
focal_class.signature: Map<Node, Set<Node>> getEdgesFor(Feed feed)
focal_method.body: @Override
      public void onAdd(Entity entity) throws IvoryException {
          Map<Node, Set<Node>> nodeEdges = null;
          switch (entity.getEntityType()) {
              case PROCESS:
                  nodeEdges = getEdgesFor((Process) entity);
                  break;
              case FEED:
                  nodeEdges = getEdgesFor((Feed) entity);
                  break;
          }
          if (nodeEdges == null)
              return;
          LOG.trace("Adding edges for " + entity.getName() + ": " + nodeEdges);
  
          for (Map.Entry<Node, Set<Node>> entry : nodeEdges.entrySet()) {
              if (graph.containsKey(entry.getKey())) {
                  graph.get(entry.getKey()).addAll(entry.getValue());
              } else {
                  graph.put(entry.getKey(), entry.getValue());
              }
          }
          LOG.trace("Merged edges to graph " + entity.getName());
      }
focal_method.class_method_signature: EntityGraph.onAdd(Entity entity)
focal_method.full_signature: @Override public void onAdd(Entity entity)
focal_method.identifier: onAdd
focal_method.invocations: getEntityType getEdgesFor getEdgesFor trace getName entrySet containsKey getKey addAll get getKey getValue put getKey getValue trace getName
focal_method.modifiers: @Override public
focal_method.parameters: (Entity entity)
focal_method.return: void
focal_method.signature: void onAdd(Entity entity)