From 9cb57ae9c816851fbc856c2c9373b22cb2de5bca Mon Sep 17 00:00:00 2001 From: SiboVG Date: Thu, 22 Sep 2022 22:54:47 +0200 Subject: [PATCH 1/6] Add unique identifier for stages --- .../sf/openrocket/rocketcomponent/AxialStage.java | 12 +++++++----- .../net/sf/openrocket/rocketcomponent/Rocket.java | 9 +++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java b/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java index 8e0f533c5..40725d608 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java +++ b/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java @@ -1,8 +1,5 @@ package net.sf.openrocket.rocketcomponent; -import java.util.ArrayList; -import java.util.Collection; - import net.sf.openrocket.l10n.Translator; import net.sf.openrocket.rocketcomponent.position.AxialMethod; import net.sf.openrocket.startup.Application; @@ -11,12 +8,12 @@ import net.sf.openrocket.util.Coordinate; public class AxialStage extends ComponentAssembly implements FlightConfigurableComponent { private static final Translator trans = Application.getTranslator(); - //private static final Logger log = LoggerFactory.getLogger(AxialStage.class); - + /** list of separations to be happening*/ protected FlightConfigurableParameterSet separations; /** number of stages */ protected int stageNumber; + private FlightConfigurationId stageId; /** * default constructor, builds a rocket with zero stages @@ -25,6 +22,7 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC this.separations = new FlightConfigurableParameterSet( new StageSeparationConfiguration()); this.axialMethod = AxialMethod.AFTER; this.stageNumber = 0; + this.stageId = new FlightConfigurationId(); } /** @@ -94,9 +92,13 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC protected RocketComponent copyWithOriginalID() { AxialStage copy = (AxialStage) super.copyWithOriginalID(); copy.separations = new FlightConfigurableParameterSet(separations); + copy.stageId = new FlightConfigurationId(); return copy; } + public FlightConfigurationId getStageId() { + return stageId; + } /** * Stages may be positioned relative to other stages. In that case, this will set the stage number diff --git a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java index 0b85db63d..8f0a632ff 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java +++ b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java @@ -198,6 +198,15 @@ public class Rocket extends ComponentAssembly { return this.stageMap.get( stageNumber); } + public AxialStage getStage(final FlightConfigurationId stageId) { + for (AxialStage stage : getStageList()) { + if (stage.getStageId().equals(stageId)) { + return stage; + } + } + return null; + } + /** * Get the topmost stage, only taking into account active stages from the flight configuration. * @param config flight configuration dictating which stages are active From 8c7fb6b67f3726fa8cec08ffc1505c8fc8308ab1 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Thu, 22 Sep 2022 22:55:17 +0200 Subject: [PATCH 2/6] [#1680] Update flight config stages based on stage ID --- .../rocketcomponent/FlightConfiguration.java | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 72fdacac1..757e11a49 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -46,22 +46,23 @@ public class FlightConfiguration implements FlightConfigurableParameter stages = new HashMap(); // Map of stage number to StageFlags of the corresponding stage + final protected Map stages = new HashMap<>(); // Map of stage number to StageFlags of the corresponding stage final protected Map motors = new HashMap(); final private Collection activeMotors = new ConcurrentLinkedQueue(); final private InstanceMap activeInstances = new InstanceMap(); @@ -130,7 +131,7 @@ public class FlightConfiguration implements FlightConfigurableParameter getAllStages() { List stages = new ArrayList<>(); for (StageFlags flags : this.stages.values()) { - stages.add( rocket.getStage(flags.stageNumber)); + stages.add( rocket.getStage(flags.stageId)); } return stages; } @@ -380,7 +381,7 @@ public class FlightConfiguration implements FlightConfigurableParameter stagesBackup = new HashMap<>(this.stages); this.stages.clear(); for (AxialStage curStage : this.rocket.getStageList()) { if (curStage == null) continue; - StageFlags flagsToAdd = new StageFlags( curStage.getStageNumber(), true); + boolean active = true; + for (FlightConfiguration.StageFlags flag : stagesBackup.values()) { + if (flag.stageId.equals(curStage.getStageId())) { + active = flag.active; + break; + } + } + StageFlags flagsToAdd = new StageFlags(curStage.getStageNumber(), curStage.getStageId(), active); this.stages.put(curStage.getStageNumber(), flagsToAdd); } } @@ -850,8 +855,8 @@ public class FlightConfiguration implements FlightConfigurableParameter Date: Sat, 24 Sep 2022 17:55:16 +0200 Subject: [PATCH 3/6] Use built-in component ID instead of extra stageID (whoops) --- .../sf/openrocket/rocketcomponent/AxialStage.java | 7 ------- .../rocketcomponent/FlightConfiguration.java | 12 ++++++------ .../net/sf/openrocket/rocketcomponent/Rocket.java | 4 ++-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java b/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java index 40725d608..df2285c37 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java +++ b/core/src/net/sf/openrocket/rocketcomponent/AxialStage.java @@ -13,7 +13,6 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC protected FlightConfigurableParameterSet separations; /** number of stages */ protected int stageNumber; - private FlightConfigurationId stageId; /** * default constructor, builds a rocket with zero stages @@ -22,7 +21,6 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC this.separations = new FlightConfigurableParameterSet( new StageSeparationConfiguration()); this.axialMethod = AxialMethod.AFTER; this.stageNumber = 0; - this.stageId = new FlightConfigurationId(); } /** @@ -92,13 +90,8 @@ public class AxialStage extends ComponentAssembly implements FlightConfigurableC protected RocketComponent copyWithOriginalID() { AxialStage copy = (AxialStage) super.copyWithOriginalID(); copy.separations = new FlightConfigurableParameterSet(separations); - copy.stageId = new FlightConfigurationId(); return copy; } - - public FlightConfigurationId getStageId() { - return stageId; - } /** * Stages may be positioned relative to other stages. In that case, this will set the stage number diff --git a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java index 757e11a49..b2cf9ce61 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java +++ b/core/src/net/sf/openrocket/rocketcomponent/FlightConfiguration.java @@ -47,9 +47,9 @@ public class FlightConfiguration implements FlightConfigurableParameter Date: Sat, 24 Sep 2022 20:49:23 +0200 Subject: [PATCH 4/6] Fix issue in stage updating for sub-stages updateStageNumbers would only update direct child stages of the rocket, instead of also ParallelStages --- .../sf/openrocket/rocketcomponent/Rocket.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java index 91f79b9a7..f7337b3e4 100644 --- a/core/src/net/sf/openrocket/rocketcomponent/Rocket.java +++ b/core/src/net/sf/openrocket/rocketcomponent/Rocket.java @@ -546,21 +546,17 @@ public class Rocket extends ComponentAssembly { * Update all the stage numbers based on their position in the component tree */ private void updateStageNumbers() { - for (RocketComponent component : getChildren()) { - if (component instanceof AxialStage) { - AxialStage stage = (AxialStage) component; - forgetStage(stage); - stage.setStageNumber(getChildPosition(stage)); - } + int stageNr = 0; + for (AxialStage stage : getSubStages()) { + forgetStage(stage); + stage.setStageNumber(stageNr); + stageNr++; } } private void updateStageMap(){ - for( RocketComponent component : getChildren() ){ - if (component instanceof AxialStage) { - AxialStage stage = (AxialStage) component; - trackStage(stage); - } + for (AxialStage stage : getSubStages() ){ + trackStage(stage); } } From bbbf0be15bdc37452fa7665ef4e0022c4396d554 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Sat, 24 Sep 2022 20:50:25 +0200 Subject: [PATCH 5/6] Fix cheating unit test ;) Booster D should have stage number 4, not 3 as it was previously --- .../rocketcomponent/ParallelStageTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/test/net/sf/openrocket/rocketcomponent/ParallelStageTest.java b/core/test/net/sf/openrocket/rocketcomponent/ParallelStageTest.java index f7c3905d1..47d9a1b44 100644 --- a/core/test/net/sf/openrocket/rocketcomponent/ParallelStageTest.java +++ b/core/test/net/sf/openrocket/rocketcomponent/ParallelStageTest.java @@ -644,15 +644,15 @@ public class ParallelStageTest extends BaseTestCase { expectedStageNumber = 2; actualStageNumber = boosterA.getStageNumber(); - assertEquals(" init order error: core: resultant positions: ", expectedStageNumber, actualStageNumber); + assertEquals(" init order error: Booster A: resultant positions: ", expectedStageNumber, actualStageNumber); expectedStageNumber = 3; actualStageNumber = boosterB.getStageNumber(); - assertEquals(" init order error: Booster A: resultant positions: ", expectedStageNumber, actualStageNumber); + assertEquals(" init order error: Booster B: resultant positions: ", expectedStageNumber, actualStageNumber); expectedStageNumber = 4; actualStageNumber = boosterC.getStageNumber(); - assertEquals(" init order error: Booster B: resultant positions: ", expectedStageNumber, actualStageNumber); + assertEquals(" init order error: Booster C: resultant positions: ", expectedStageNumber, actualStageNumber); // remove Booster B coreBody.removeChild(1); @@ -666,11 +666,11 @@ public class ParallelStageTest extends BaseTestCase { assertEquals(" Stage tracking error: removed booster A, but configuration not updated: " + treedump, expectedStageCount, actualStageCount); ParallelStage boosterD = createExtraBooster(); - boosterC.setName("Booster D Stage"); + boosterD.setName("Booster D Stage"); coreBody.addChild(boosterD); - boosterC.setAxialOffset(AxialMethod.BOTTOM, 0); + boosterD.setAxialOffset(AxialMethod.BOTTOM, 0); - expectedStageNumber = 3; + expectedStageNumber = 4; actualStageNumber = boosterD.getStageNumber(); assertEquals(" init order error: Booster D: resultant positions: ", expectedStageNumber, actualStageNumber); From d9af73582e461c3360d870b8fd80d17f037a7ffa Mon Sep 17 00:00:00 2001 From: SiboVG Date: Sat, 24 Sep 2022 21:22:43 +0200 Subject: [PATCH 6/6] Add unit tests for axial stage disabling --- .../rocketcomponent/AxialStageTest.java | 225 ++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 core/test/net/sf/openrocket/rocketcomponent/AxialStageTest.java diff --git a/core/test/net/sf/openrocket/rocketcomponent/AxialStageTest.java b/core/test/net/sf/openrocket/rocketcomponent/AxialStageTest.java new file mode 100644 index 000000000..e745df42c --- /dev/null +++ b/core/test/net/sf/openrocket/rocketcomponent/AxialStageTest.java @@ -0,0 +1,225 @@ +package net.sf.openrocket.rocketcomponent; + +import net.sf.openrocket.util.BaseTestCase.BaseTestCase; +import net.sf.openrocket.util.TestRockets; +import org.junit.Test; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +public class AxialStageTest extends BaseTestCase { + /** + * Test whether we can disable a stage, and that it is registered only in the target flight configuration and not + * in the others. + */ + @Test + public void testDisableStage() { + final Rocket rocket = TestRockets.makeFalcon9Heavy(); + final FlightConfiguration config = rocket.getSelectedConfiguration(); + final FlightConfigurationId fcid = rocket.createFlightConfiguration(new FlightConfigurationId()); + final FlightConfiguration config2 = rocket.getFlightConfiguration(fcid); + + // Disable the payload stage + config._setStageActive(0, false); + assertFalse(" Payload stage in selected configuration should be disabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Enable the payload stage + config._setStageActive(0, true); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Toggle the payload stage to False + config.toggleStage(0); + assertFalse(" Payload stage in selected configuration should be disabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Toggle the payload stage to True + config.toggleStage(0); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Set only stage + config.setOnlyStage(1); + assertFalse(" Payload stage in selected configuration should be disabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Change stage activeness in other configuration + config2.toggleStage(1); + assertFalse(" Payload stage in selected configuration should be disabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertFalse(" Core stage in other configuration should be disabled", config2.isStageActive(1)); + assertFalse(" Booster stage in other configuration should be disabled", config2.isStageActive(2)); + config.setAllStages(); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertFalse(" Core stage in other configuration should be disabled", config2.isStageActive(1)); + assertFalse(" Booster stage in other configuration should be disabled", config2.isStageActive(2)); + + // Toggle stage with activateSubStages edited + config.setAllStages(); + config2.setAllStages(); + config._setStageActive(1, false, true); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertFalse(" Core stage in selected configuration should be disabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + config._setStageActive(1, true, false); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + } + + /** + * Test disabling a stage and then moving the stage in the component tree. + */ + @Test + public void testDisableStageAndMove() { + final Rocket rocket = TestRockets.makeFalcon9Heavy(); + final FlightConfiguration config = rocket.getSelectedConfiguration(); + final FlightConfigurationId fcid = rocket.createFlightConfiguration(new FlightConfigurationId()); + final FlightConfiguration config2 = rocket.getFlightConfiguration(fcid); + + // Disable the payload stage + config.setAllStages(); + config._setStageActive(0, false); + AxialStage payloadStage = rocket.getStage(0); + + // Move the payload stage to the back of the rocket + try { + rocket.freeze(); + rocket.removeChild(payloadStage); + rocket.addChild(payloadStage); // Moves to the back + } finally { + rocket.thaw(); // Unfreeze + } + + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(1)); + assertFalse(" Payload stage in selected configuration should be disabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Re-enable the payload stage + config._setStageActive(payloadStage.getStageNumber(), true); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Disable the core stage (and booster stage) + config._setStageActive(0, false); + assertFalse(" Core stage in selected configuration should be disabled", config.isStageActive(0)); + assertFalse(" Booster stage in selected configuration should be disabled ", config.isStageActive(1)); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + + // Move the core stage to the back of the rocket + AxialStage coreStage = rocket.getStage(0); + try { + rocket.freeze(); + rocket.removeChild(coreStage); + rocket.addChild(coreStage); // Moves to the back + } finally { + rocket.thaw(); // Unfreeze + } + + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertFalse(" Core stage in selected configuration should be disabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled ", config.isStageActive(2)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + } + + /** + * Test disabling a stage and then copying that stage. + */ + @Test + public void testDisableStageAndCopy() { + final Rocket rocket = TestRockets.makeFalcon9Heavy(); + final FlightConfiguration config = rocket.getSelectedConfiguration(); + final FlightConfigurationId fcid = rocket.createFlightConfiguration(new FlightConfigurationId()); + final FlightConfiguration config2 = rocket.getFlightConfiguration(fcid); + + // Disable the core stage + config.setAllStages(); + config._setStageActive(1, false); + AxialStage coreStage = rocket.getStage(1); + + // Copy the core stage to the back of the rocket + AxialStage coreStageCopy = (AxialStage) coreStage.copy(); + rocket.addChild(coreStageCopy); + + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertFalse(" Core stage in selected configuration should be disabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled", config.isStageActive(2)); + assertTrue(" Core copy stage in selected configuration should be enabled", config.isStageActive(3)); + assertTrue(" Booster copy stage in selected configuration should be enabled", config.isStageActive(4)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + assertTrue(" Core copy stage in selected configuration should be enabled", config2.isStageActive(3)); + assertTrue(" Booster copy stage in selected configuration should be enabled", config2.isStageActive(4)); + + // Disable the copied core stage (not the booster copy stage) + config._setStageActive(3, false, false); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertFalse(" Core stage in selected configuration should be disabled", config.isStageActive(1)); + assertFalse(" Booster stage in selected configuration should be disabled", config.isStageActive(2)); + assertFalse(" Core copy stage in selected configuration should be disabled", config.isStageActive(3)); + assertTrue(" Booster copy stage in selected configuration should be enabled", config.isStageActive(4)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + assertTrue(" Core copy stage in selected configuration should be enabled", config2.isStageActive(3)); + assertTrue(" Booster copy stage in selected configuration should be enabled", config2.isStageActive(4)); + + // Toggle the original core stage back + config.toggleStage(1); + assertTrue(" Payload stage in selected configuration should be enabled", config.isStageActive(0)); + assertTrue(" Core stage in selected configuration should be enabled", config.isStageActive(1)); + assertTrue(" Booster stage in selected configuration should be enabled", config.isStageActive(2)); + assertFalse(" Core copy stage in selected configuration should be disabled", config.isStageActive(3)); + assertTrue(" Booster copy stage in selected configuration should be enabled", config.isStageActive(4)); + assertTrue(" Payload stage in other configuration should be enabled", config2.isStageActive(0)); + assertTrue(" Core stage in other configuration should be enabled", config2.isStageActive(1)); + assertTrue(" Booster stage in other configuration should be enabled", config2.isStageActive(2)); + assertTrue(" Core copy stage in selected configuration should be enabled", config2.isStageActive(3)); + assertTrue(" Booster copy stage in selected configuration should be enabled", config2.isStageActive(4)); + } +}