Skip to content

Commit

Permalink
Pull request #464: ROCKSOLID-6759 Refactor DonkeyEngineController to …
Browse files Browse the repository at this point in the history
…make it and its subclasses more testable.

Merge in MC/connect from feature/ROCKSOLID-6759-add-unit-tests-advancednodeenginecontroller to development

* commit 'b1d34fc37fd8ab2c482b29656e2590c609038607':
  ROCKSOLID-6759 Refactor DonkeyEngineController to make it and its subclasses more testable.
  • Loading branch information
narupley committed Sep 2, 2021
2 parents c339428 + b1d34fc commit 3fb3d4a
Showing 1 changed file with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ public static EngineController getInstance() {

private Donkey donkey = Donkey.getInstance();
private Logger logger = Logger.getLogger(DonkeyEngineController.class);
private ConfigurationController configurationController = ControllerFactory.getFactory().createConfigurationController();
private ScriptController scriptController = ControllerFactory.getFactory().createScriptController();
private ChannelController channelController = ControllerFactory.getFactory().createChannelController();
private com.mirth.connect.donkey.server.controllers.ChannelController donkeyChannelController = com.mirth.connect.donkey.server.controllers.ChannelController.getInstance();
private EventController eventController = ControllerFactory.getFactory().createEventController();
private ExtensionController extensionController = ControllerFactory.getFactory().createExtensionController();
private ContextFactoryController contextFactoryController = ControllerFactory.getFactory().createContextFactoryController();
private CodeTemplateController codeTemplateController = ControllerFactory.getFactory().createCodeTemplateController();
protected ConfigurationController configurationController = getConfigurationController();
protected ScriptController scriptController = getScriptController();
protected ChannelController channelController = getChannelController();
protected com.mirth.connect.donkey.server.controllers.ChannelController donkeyChannelController = com.mirth.connect.donkey.server.controllers.ChannelController.getInstance();
protected EventController eventController = getEventController();
protected ExtensionController extensionController = getExtensionController();
protected ContextFactoryController contextFactoryController = getContextFactoryController();
protected CodeTemplateController codeTemplateController = getCodeTemplateController();
private Map<String, ExecutorService> engineExecutors = new ConcurrentHashMap<String, ExecutorService>();
private Set<Channel> deployingChannels = Collections.synchronizedSet(new HashSet<Channel>());
private Set<Channel> undeployingChannels = Collections.synchronizedSet(new HashSet<Channel>());
Expand All @@ -184,6 +184,34 @@ private enum StatusTask {

protected DonkeyEngineController() {}

protected ConfigurationController getConfigurationController() {
return ControllerFactory.getFactory().createConfigurationController();
}

protected ScriptController getScriptController() {
return ControllerFactory.getFactory().createScriptController();
}

protected ChannelController getChannelController() {
return ControllerFactory.getFactory().createChannelController();
}

protected EventController getEventController() {
return ControllerFactory.getFactory().createEventController();
}

protected ExtensionController getExtensionController() {
return ControllerFactory.getFactory().createExtensionController();
}

protected ContextFactoryController getContextFactoryController() {
return ControllerFactory.getFactory().createContextFactoryController();
}

protected CodeTemplateController getCodeTemplateController() {
return ControllerFactory.getFactory().createCodeTemplateController();
}

@Override
public void startEngine() throws StartException, StopException, ControllerException, InterruptedException {
logger.debug("starting donkey engine");
Expand Down

0 comments on commit 3fb3d4a

Please sign in to comment.