From a1d89987cd07e7e230c65e4ac6f5ca0b3857dee6 Mon Sep 17 00:00:00 2001 From: Vladislav Chumak Date: Tue, 19 Feb 2019 22:43:55 +0100 Subject: [PATCH] Fixed failing test case by adjusting clearState to clear persistence --- .../WindEstimationFactoryServiceImpl.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/java/com.sap.sailing.windestimation/src/com/sap/sailing/windestimation/integration/WindEstimationFactoryServiceImpl.java b/java/com.sap.sailing.windestimation/src/com/sap/sailing/windestimation/integration/WindEstimationFactoryServiceImpl.java index 839fc8ac6af..fd138198fda 100644 --- a/java/com.sap.sailing.windestimation/src/com/sap/sailing/windestimation/integration/WindEstimationFactoryServiceImpl.java +++ b/java/com.sap.sailing.windestimation/src/com/sap/sailing/windestimation/integration/WindEstimationFactoryServiceImpl.java @@ -90,7 +90,7 @@ public class WindEstimationFactoryServiceImpl extends MODEL_STORE.importPersistedModels(serializedModelsForDomainType, domainType); } } - clearState(); + reloadWindEstimationModels(); } @Override @@ -138,15 +138,19 @@ public class WindEstimationFactoryServiceImpl extends for (ModelDomainType domainType : modelDomainTypesRequiredByWindEstimation) { MODEL_STORE.deleteAll(domainType); } - clearState(); + reloadWindEstimationModels(); + } + + @Override + public void clearState() throws Exception { + clearReplicaState(); } /** * Clears/Reloads all caches with machine learning models. Notifies ready state change listeners about the new ready * state of this wind estimation instance. */ - @Override - public void clearState() { + public void reloadWindEstimationModels() { maneuverClassifiersCache.clearCache(); gaussianBasedTwdTransitionDistributionCache.clearCache(); List modelsChangedListeners; @@ -169,7 +173,7 @@ public class WindEstimationFactoryServiceImpl extends MODEL_STORE.deleteAll(domainType); MODEL_STORE.importPersistedModels(exportedModels, domainType); } - clearState(); + reloadWindEstimationModels(); } /**