* @version $Revision: 2002 $
*/
public class MulticasterTestCase extends TestCase {
public void testOrderOfInstantiationShouldBeDependencyOrder() throws Exception {
DefaultPicoContainer pico = new DefaultPicoContainer();
pico.registerComponentImplementation("recording", StringBuffer.class);
pico.registerComponentImplementation(DefaultPicoContainerLifecycleTestCase.Four.class);
pico.registerComponentImplementation(DefaultPicoContainerLifecycleTestCase.Two.class);
pico.registerComponentImplementation(DefaultPicoContainerLifecycleTestCase.One.class);
pico.registerComponentImplementation(DefaultPicoContainerLifecycleTestCase.Three.class);
ProxyFactory proxyFactory = new StandardProxyFactory();
Startable startable = (Startable) Multicaster.object(pico, true, proxyFactory);
Startable stoppable = (Startable) Multicaster.object(pico, false, proxyFactory);
Disposable disposable = (Disposable) Multicaster.object(pico, false, proxyFactory);
startable.start();
stoppable.stop();
disposable.dispose();
assertEquals("<One<Two<Three<FourFour>Three>Two>One>!Four!Three!Two!One", pico.getComponentInstance("recording").toString());
}