-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3bd48a
commit 1f74f8a
Showing
8 changed files
with
109 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/AllChildrenTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package gov.nasa.jpl.aerie.scheduler; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.HashSet; | ||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class AllChildrenTest { | ||
@Test | ||
public void testAllChildrenAnnotation(){ | ||
final var bananaSchedulerModel = SimulationUtility.getBananaSchedulerModel(); | ||
final var children = bananaSchedulerModel.getChildren(); | ||
final var bananaMissionModel = SimulationUtility.getBananaMissionModel(); | ||
final var allActivityTypes = bananaMissionModel.getDirectiveTypes().directiveTypes().keySet(); | ||
//there is one key per activity type in the children map | ||
allActivityTypes.forEach(at -> assertTrue(children.containsKey(at))); | ||
//the only declared child of parent is the one present in the children map | ||
assertEquals(List.of("child"), children.get("parent")); | ||
//the declared absence of children of grandchild is reported in the children map | ||
assertEquals(List.of(), children.get("grandchild")); | ||
//an activity without effect model does not have any children | ||
assertEquals(List.of(), children.get("ParameterTest")); | ||
//an activity with an effect model but with no @AllChildren annotation will result in all activity types of the mission model being reported as its potential children | ||
assertEquals(new HashSet<>(allActivityTypes.stream().toList()), new HashSet<>(children.get("BiteBanana"))); | ||
} | ||
} |