}
allOps.addAll(bootOperations);
StringConfigurationPersister persister = new StringConfigurationPersister(allOps, testParser, persistXml);
controllerExtensionRegistry.setWriterRegistry(persister);
controllerExtensionRegistry.setPathManager(pathManager);
ModelTestModelControllerService svc = TestModelControllerService.create(mainExtension, controllerInitializer, additionalInit, controllerExtensionRegistry,
persister, additionalInit.isValidateOperations(), registerTransformers);
ServiceBuilder<ModelController> builder = target.addService(Services.JBOSS_SERVER_CONTROLLER, svc);
builder.addDependency(PathManagerService.SERVICE_NAME); // ensure this is up before the ModelControllerService, as it would be in a real server
builder.install();
target.addService(PathManagerService.SERVICE_NAME, pathManager).install();
additionalInit.addExtraServices(target);
//sharedState = svc.state;
svc.waitForSetup();
//processState.setRunning();
KernelServicesImpl kernelServices = new KernelServicesImpl(container, svc, persister, svc.getRootRegistration(),
new OperationValidator(svc.getRootRegistration()), mainSubsystemName, controllerExtensionRegistry, legacyModelVersion, svc.isSuccessfulBoot(), svc.getBootError(), registerTransformers);
return kernelServices;
}