@Test public void aliasEventReceived() throws Exception { List aliases = this.eventListener.getAliases("testBean"); assertEquals(2, aliases.size()); AliasDefinition aliasDefinition1 = (AliasDefinition) aliases.get(0); assertEquals("testBeanAlias1", aliasDefinition1.getAlias()); assertTrue(aliasDefinition1.getSource() instanceof Element); AliasDefinition aliasDefinition2 = (AliasDefinition) aliases.get(1); assertEquals("testBeanAlias2", aliasDefinition2.getAlias()); assertTrue(aliasDefinition2.getSource() instanceof Element); }
@Override public void aliasRegistered(AliasDefinition aliasDefinition) { List aliases = (List) this.aliasMap.get(aliasDefinition.getBeanName()); if(aliases == null) { aliases = new ArrayList(); this.aliasMap.put(aliasDefinition.getBeanName(), aliases); } aliases.add(aliasDefinition); }
public void testAliasEventReceived() throws Exception { List aliases = this.eventListener.getAliases("testBean"); assertEquals(2, aliases.size()); AliasDefinition aliasDefinition1 = (AliasDefinition) aliases.get(0); assertEquals("testBeanAlias1", aliasDefinition1.getAlias()); assertTrue(aliasDefinition1.getSource() instanceof Element); AliasDefinition aliasDefinition2 = (AliasDefinition) aliases.get(1); assertEquals("testBeanAlias2", aliasDefinition2.getAlias()); assertTrue(aliasDefinition2.getSource() instanceof Element); }
public void aliasRegistered(AliasDefinition alias) { if(! aliases.containsKey(alias.getAlias())) { aliases.put(alias.getAlias(), alias.getBeanName()); } }
@Override public void aliasRegistered(AliasDefinition aliasDefinition) { log.info("Registered alias [" + aliasDefinition.getAlias() + "] for bean " + aliasDefinition.getBeanName()); }