From d09cd23783d3d171ae726ab10e9e058cefa35165 Mon Sep 17 00:00:00 2001 From: fran_tb Date: Mon, 14 Aug 2023 18:58:07 +0200 Subject: [PATCH] Task #176 add test case for overwrite flag --- .../extension/cefx/calculation/modes/ParameterSetterTest.java | 1 + .../virsat/model/extension/cefx/calculation/ParameterSetter.java | 1 + 2 files changed, 2 insertions(+) diff --git a/de.dlr.sc.virsat.model.extension.cefx.test/src/de/dlr/sc/virsat/model/extension/cefx/calculation/modes/ParameterSetterTest.java b/de.dlr.sc.virsat.model.extension.cefx.test/src/de/dlr/sc/virsat/model/extension/cefx/calculation/modes/ParameterSetterTest.java index 2faba56b..408acb62 100644 --- a/de.dlr.sc.virsat.model.extension.cefx.test/src/de/dlr/sc/virsat/model/extension/cefx/calculation/modes/ParameterSetterTest.java +++ b/de.dlr.sc.virsat.model.extension.cefx.test/src/de/dlr/sc/virsat/model/extension/cefx/calculation/modes/ParameterSetterTest.java @@ -70,6 +70,7 @@ public void testSetNumberLiteral() { assertEquals("Case parameter = numberLiteral: Default Value Set Correctly", Double.valueOf(nl.getValue()), parameter.getDefaultValue(), TEST_EPSILON); double newIdleValue = parameter.getModeValues().get(0).getValue(); assertEquals("Case parameter = numberLiteral: Idle Value Set Correctly", Double.valueOf(nl.getValue()), newIdleValue, TEST_EPSILON); + assertEquals("Make sure equation engine sets overwrite flag", parameter.getDefaultValueBean().getOverride(), true); } @Test diff --git a/de.dlr.sc.virsat.model.extension.cefx/src/de/dlr/sc/virsat/model/extension/cefx/calculation/ParameterSetter.java b/de.dlr.sc.virsat.model.extension.cefx/src/de/dlr/sc/virsat/model/extension/cefx/calculation/ParameterSetter.java index 59e00a0d..da79d443 100644 --- a/de.dlr.sc.virsat.model.extension.cefx/src/de/dlr/sc/virsat/model/extension/cefx/calculation/ParameterSetter.java +++ b/de.dlr.sc.virsat.model.extension.cefx/src/de/dlr/sc/virsat/model/extension/cefx/calculation/ParameterSetter.java @@ -82,6 +82,7 @@ private List set(CategoryAssignment ca, NumberLiteralResult r UnitValuePropertyInstance pviDefault = (UnitValuePropertyInstance) parameter.getDefaultValueBean().getTypeInstance(); setProblems.addAll(nls.set(pviDefault, result)); + pviDefault.setOverride(true); // Assign the value to the additional modes