svcCtrl.verify();
}
public void testExecuteNoDefWithGoodReference() throws Exception {
MockControl chCtrl = MockClassControl.createNiceControl(ComponentHelper.class);
ComponentHelper cHelper = (ComponentHelper)chCtrl.getMock();
MockControl prjCtrl = MockClassControl.createNiceControl(Project.class);
Project project = (Project)prjCtrl.getMock();
project.getReference("ant.ComponentHelper");
prjCtrl.setReturnValue(cHelper);
MockControl vfyCtrl = MockClassControl.createNiceControl(ServiceVerifyTask.class);
ServiceVerifyTask verify = (ServiceVerifyTask)vfyCtrl.getMock();
verify.getProject();
vfyCtrl.setReturnValue(project, 2);
verify.execute();
vfyCtrl.setVoidCallable();
MockControl svcCtrl = MockClassControl.createControl(ServiceDef.class);
ServiceDef service = (ServiceDef)svcCtrl.getMock();
service.getVerifyTask();
svcCtrl.setReturnValue(verify);
service.start();
svcCtrl.setVoidCallable();
ServiceInstance instance = new ServiceInstance();
instance.setProject(project);
instance.setReference("foo");
MockControl atdCtrl = MockClassControl.createControl(AntTypeDefinition.class);
AntTypeDefinition typeDef = (AntTypeDefinition)atdCtrl.getMock();
typeDef.create(project);
ServiceInstance helperInstance = new ServiceInstance();
helperInstance.setServiceDef(service);
atdCtrl.setReturnValue(helperInstance);
cHelper.getDefinition("foo");
chCtrl.setReturnValue(typeDef);
chCtrl.replay();
prjCtrl.replay();
vfyCtrl.replay();