@Override public List<String[]> getAutoStartOrder(CubeDockerConfiguration config) { return AutoStartOrderUtil.getAutoStartOrder(config); }
@Override public List<String[]> getAutoStartOrder(CubeDockerConfiguration config) { return AutoStartOrderUtil.getAutoStartOrder(config); }
public static List<String[]> getAutoStopOrder(CubeDockerConfiguration config) { List<String[]> autoStartOrder = getAutoStartOrder(config); Collections.reverse(autoStartOrder); return autoStartOrder; }
public static List<String[]> getAutoStopOrder(CubeDockerConfiguration config) { List<String[]> autoStartOrder = getAutoStartOrder(config); Collections.reverse(autoStartOrder); return autoStartOrder; }
@Test(expected = IllegalArgumentException.class) public void shouldFailOnRecursiveLinks() throws Exception { AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_RECURSIVE_LINKS, "A", "B")); }
@Test public void shouldSortSingleRootWithMultipleLinks() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_SINGLE_ROOT_AND_MULTIPLE_LINKS, "C", "A")); assertExecutionSteps(sorted, new String[] {"B"}, new String[] {"A", "C"}); }
@Test public void shouldSortSingleRootWithMultipleDependsOn() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_SINGLE_ROOT_AND_MULTIPLE_DEPENDS, "C", "A")); assertExecutionSteps(sorted, new String[] {"B"}, new String[] {"A", "C"}); }
@Test public void shouldSortSingleRootWithMultipleDependsOnMustHavePriorityOverLinks() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_SINGLE_ROOT_AND_MULTIPLE_DEPENDS_AND_LINK, "C", "A")); assertExecutionSteps(sorted, new String[] {"B"}, new String[] {"A", "C"}); }
@Test public void shouldSortMultipleNonLinkedRoots() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_MULTIPLE_ROOTS, "A", "B")); assertExecutionSteps(sorted, new String[] {"A", "B"}); }
@Test public void shouldSortMultipleRootWithSingleLinks() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_MULTIPLE_ROOTS_AND_SINGLE_LINK, "C", "A")); assertExecutionSteps(sorted, new String[] {"B", "C"}, new String[] {"A"}); }
@Test public void shouldSortNoKnownLinks() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_NO_KNOWN_LINK, "A")); assertExecutionSteps(sorted, new String[] {"A"}); }
@Test public void shouldSortSingleLink() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_SINGLE_LINK, "A")); assertExecutionSteps(sorted, new String[] {"B"}, new String[] {"A"}); }
@Test public void shouldSortSingleNonLinkedRoots() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_MULTIPLE_ROOTS, "A")); assertExecutionSteps(sorted, new String[] {"A"}); }
@Test public void shouldSortMultiRootWithMultipleLinks() throws Exception { List<String[]> sorted = AutoStartOrderUtil.getAutoStartOrder( create(SCENARIO_MULTI_ROOT_AND_MULTIPLE_LINKS, "A", "F")); assertExecutionSteps(sorted, new String[] {"B", "E"}, new String[] {"D", "C"}, new String[] {"A", "F"}); }