super(name);
}
public void testBean() throws Exception
{
IMainDeployer md = (IMainDeployer) getBean("MainDeployer");
assertNotNull(md);
assertEquals("2 deployers", 2, md.getDeployers().size());
md.addDeployment("thing.xar");
md.process();
HashSet<IDeployerMethod> interceptedCalled = DeployerAspects.getCalled();
SampleDeployer d1 = (SampleDeployer) getBean("SampleDeployer1");
SampleDeployer d2 = (SampleDeployer) getBean("SampleDeployer2");
assertTrue("SampleDeployer1.prepareDeploy",
d1.getCalled().contains(IDeployerMethod.prepareDeploy));
assertTrue("SampleDeployer1.commitDeploy",
d1.getCalled().contains(IDeployerMethod.commitDeploy));
assertTrue("SampleDeployer2.prepareDeploy",
d2.getCalled().contains(IDeployerMethod.prepareDeploy));
assertTrue("SampleDeployer2.commitDeploy",
d2.getCalled().contains(IDeployerMethod.commitDeploy));
assertTrue("DeployerAspects.prepareDeploy",
interceptedCalled.contains(IDeployerMethod.prepareDeploy));
assertTrue("DeployerAspects.commitDeploy",
interceptedCalled.contains(IDeployerMethod.commitDeploy));
md.removeDeployment("thing.xar");
md.process();
assertTrue("SampleDeployer1.prepareUndeploy",
d1.getCalled().contains(IDeployerMethod.prepareUndeploy));
assertTrue("SampleDeployer1.commitUndeploy",
d1.getCalled().contains(IDeployerMethod.commitUndeploy));