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: cluster
test_class.modifier: private static
test_class.original_string: private static Cluster cluster;
test_class.type: Cluster
test_class.var_name: cluster
test_class.file: common/src/test/java/org/apache/ivory/group/FeedGroupMapTest.java
test_class.identifier: FeedGroupMapTest
test_class.superclass: extends AbstractTestBase
test_case.body: @Test
  	public void testOnRemove() throws IvoryException, JAXBException {
  		Feed feed1 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
  				FeedGroupMapTest.class
  						.getResourceAsStream("/config/feed/feed-0.1.xml"));
  		feed1.setName("f1");
  		store.publish(EntityType.CLUSTER, cluster);
  		feed1.setGroups("group7,group8,group9");
  		Location location = new Location();
  		location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/fraud/${MONTH}-${DAY}/ad");
          location.setType(LocationType.DATA);
          feed1.setLocations(new Locations());
          feed1.getLocations().getLocations().add(location);
  		store.publish(EntityType.FEED, feed1);
  
  		Feed feed2 = (Feed) EntityType.FEED.getUnmarshaller().unmarshal(
  				FeedGroupMapTest.class
  						.getResourceAsStream("/config/feed/feed-0.1.xml"));
  		feed2.setName("f2");
  		feed2.setGroups("group7,group8,group10");
  		location.setPath("/projects/bi/rmc/daily/ad/${YEAR}/${MONTH}/${DAY}/ad2");
          location.setType(LocationType.DATA);
          feed2.setLocations(new Locations());
          feed2.getLocations().getLocations().add(location);
  		store.publish(EntityType.FEED, feed2);
  
  		Map<String, FeedGroup> groupMapping = FeedGroupMap.get()
  				.getGroupsMapping();
  
  		store.remove(EntityType.FEED, "f2");
  
  		FeedGroup group = groupMapping.get("group7");
  		Assert.assertEquals(group.getName(), "group7");
  		Assert.assertEquals(group.getFeeds().size(), 1);
  
  		group = groupMapping.get("group8");
  		Assert.assertEquals(group.getName(), "group8");
  		Assert.assertEquals(group.getFeeds().size(), 1);
  
  		group = groupMapping.get("group10");
  		Assert.assertEquals(null, group);
  
  		store.remove(EntityType.FEED, "f1");
  
  		group = groupMapping.get("group7");
  		Assert.assertEquals(null, group);
  
  		group = groupMapping.get("group8");
  		Assert.assertEquals(null, group);
  
  		group = groupMapping.get("group9");
  		Assert.assertEquals(null, group);
  
  	}
test_case.class_method_signature: FeedGroupMapTest.testOnRemove()
test_case.full_signature: @Test public void testOnRemove()
test_case.identifier: testOnRemove
test_case.invocations: unmarshal getUnmarshaller getResourceAsStream setName publish setGroups setPath setType setLocations add getLocations getLocations publish unmarshal getUnmarshaller getResourceAsStream setName setGroups setPath setType setLocations add getLocations getLocations publish getGroupsMapping get remove get assertEquals getName assertEquals size getFeeds get assertEquals getName assertEquals size getFeeds get assertEquals remove get assertEquals get assertEquals get assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOnRemove()
focal_class.declarator: instance = new FeedGroupMap()
focal_class.modifier: private static final
focal_class.original_string: private static final FeedGroupMap instance = new FeedGroupMap();
focal_class.type: FeedGroupMap
focal_class.var_name: instance
focal_class.declarator: groupsMapping = new ConcurrentHashMap<String, FeedGroup>()
focal_class.modifier: private
focal_class.original_string: private Map<String, FeedGroup> groupsMapping = new ConcurrentHashMap<String, FeedGroup>();
focal_class.type: Map<String, FeedGroup>
focal_class.var_name: groupsMapping
focal_class.file: common/src/main/java/org/apache/ivory/group/FeedGroupMap.java
focal_class.identifier: FeedGroupMap
focal_class.interfaces: implements ConfigurationChangeListener
focal_class.class_method_signature: FeedGroupMap.FeedGroupMap()
focal_class.full_signature: private  FeedGroupMap()
focal_class.identifier: FeedGroupMap
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  FeedGroupMap()
focal_class.class_method_signature: FeedGroupMap.get()
focal_class.full_signature: public static FeedGroupMap get()
focal_class.identifier: get
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: FeedGroupMap
focal_class.signature: FeedGroupMap get()
focal_class.class_method_signature: FeedGroupMap.getGroupsMapping()
focal_class.full_signature: public Map<String, FeedGroup> getGroupsMapping()
focal_class.identifier: getGroupsMapping
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, FeedGroup>
focal_class.signature: Map<String, FeedGroup> getGroupsMapping()
focal_class.class_method_signature: FeedGroupMap.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: FeedGroupMap.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: FeedGroupMap.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: FeedGroupMap.addGroups(String feed, Set<FeedGroup> groups)
focal_class.full_signature: private void addGroups(String feed, Set<FeedGroup> groups)
focal_class.identifier: addGroups
focal_class.modifiers: private
focal_class.parameters: (String feed, Set<FeedGroup> groups)
focal_class.return: void
focal_class.signature: void addGroups(String feed, Set<FeedGroup> groups)
focal_class.class_method_signature: FeedGroupMap.getGroups(String groups, Frequency frequency, String path)
focal_class.full_signature: public Set<FeedGroup> getGroups(String groups, Frequency frequency, String path)
focal_class.identifier: getGroups
focal_class.modifiers: public
focal_class.parameters: (String groups, Frequency frequency, String path)
focal_class.return: Set<FeedGroup>
focal_class.signature: Set<FeedGroup> getGroups(String groups, Frequency frequency, String path)
focal_class.class_method_signature: FeedGroupMap.getGroups(org.apache.ivory.entity.v0.feed.Feed feed)
focal_class.full_signature: public Set<FeedGroup> getGroups(org.apache.ivory.entity.v0.feed.Feed feed)
focal_class.identifier: getGroups
focal_class.modifiers: public
focal_class.parameters: (org.apache.ivory.entity.v0.feed.Feed feed)
focal_class.return: Set<FeedGroup>
focal_class.signature: Set<FeedGroup> getGroups(org.apache.ivory.entity.v0.feed.Feed feed)
focal_method.body: @Override
  	public void onRemove(Entity entity) throws IvoryException {
  		if (entity.getEntityType().equals(EntityType.FEED)) {
  			Feed feed = (Feed) entity;
  			if (StringUtils.isEmpty(feed.getGroups())) {
  				return;
  			}
  			String[] groups = feed.getGroups().split(",");
  			for (String group : groups) {
  				groupsMapping.get(group).getFeeds().remove(entity.getName());
  				if (groupsMapping.get(group).getFeeds().size() == 0) {
  					groupsMapping.remove(group);
  				}
  			}
  
  		}
  
  	}
focal_method.class_method_signature: FeedGroupMap.onRemove(Entity entity)
focal_method.full_signature: @Override public void onRemove(Entity entity)
focal_method.identifier: onRemove
focal_method.invocations: equals getEntityType isEmpty getGroups split getGroups remove getFeeds get getName size getFeeds get remove
focal_method.modifiers: @Override public
focal_method.parameters: (Entity entity)
focal_method.return: void
focal_method.signature: void onRemove(Entity entity)