use of org.eclipse.che.ide.api.constraints.Constraints in project che by eclipse.
the class DefaultActionGroupTest method addTwoBefore.
@Test
public void addTwoBefore() {
// given
mockRegisterActions();
defaultActionGroup.add(firstAction);
defaultActionGroup.add(secondAction);
defaultActionGroup.add(thirdAction, new Constraints(BEFORE, "secondAction"));
defaultActionGroup.add(fourthAction);
defaultActionGroup.add(fifthAction, new Constraints(BEFORE, "secondAction"));
defaultActionGroup.add(sixthAction);
// when
Action[] result = defaultActionGroup.getChildren(mock(ActionEvent.class));
//then
assertThat(Arrays.asList(result)).hasSize(6).containsExactly(firstAction, thirdAction, fifthAction, secondAction, fourthAction, sixthAction);
}
use of org.eclipse.che.ide.api.constraints.Constraints in project che by eclipse.
the class DefaultActionGroupTest method addComplexAfter.
@Test
public void addComplexAfter() {
// given
mockRegisterActions();
defaultActionGroup.add(firstAction);
defaultActionGroup.add(secondAction, new Constraints(AFTER, "fifthAction"));
defaultActionGroup.add(thirdAction);
defaultActionGroup.add(fourthAction);
defaultActionGroup.add(fifthAction, new Constraints(AFTER, "firstAction"));
defaultActionGroup.add(sixthAction);
// when
Action[] result = defaultActionGroup.getChildren(mock(ActionEvent.class));
// then
assertThat(Arrays.asList(result)).hasSize(6).containsExactly(firstAction, fifthAction, secondAction, thirdAction, fourthAction, sixthAction);
}
use of org.eclipse.che.ide.api.constraints.Constraints in project che by eclipse.
the class DefaultActionGroupTest method addActionToTheEndWhenConstraintUnsatisfied.
@Test
public void addActionToTheEndWhenConstraintUnsatisfied() {
// given
mockRegisterActions();
defaultActionGroup.add(firstAction);
defaultActionGroup.add(secondAction, new Constraints(AFTER, "tenthAction"));
defaultActionGroup.add(thirdAction);
defaultActionGroup.add(fourthAction);
defaultActionGroup.add(fifthAction);
defaultActionGroup.add(sixthAction);
// when
Action[] result = defaultActionGroup.getChildren(mock(ActionEvent.class));
// then
assertThat(Arrays.asList(result)).hasSize(6).containsExactly(firstAction, thirdAction, fourthAction, fifthAction, sixthAction, secondAction);
}
use of org.eclipse.che.ide.api.constraints.Constraints in project che by eclipse.
the class DefaultActionGroupTest method addOneAfter.
@Test
public void addOneAfter() {
// given
mockRegisterActions();
defaultActionGroup.add(firstAction);
defaultActionGroup.add(secondAction);
defaultActionGroup.add(thirdAction);
defaultActionGroup.add(fourthAction, new Constraints(AFTER, "firstAction"));
defaultActionGroup.add(fifthAction);
defaultActionGroup.add(sixthAction);
// when
Action[] result = defaultActionGroup.getChildren(mock(ActionEvent.class));
//then
assertThat(Arrays.asList(result)).hasSize(6).containsExactly(firstAction, fourthAction, secondAction, thirdAction, fifthAction, sixthAction);
}
use of org.eclipse.che.ide.api.constraints.Constraints in project che by eclipse.
the class DefaultActionGroupTest method addOneBeforeNotAdded.
@Test
public void addOneBeforeNotAdded() {
// given
mockRegisterActions();
defaultActionGroup.add(firstAction);
defaultActionGroup.add(secondAction);
defaultActionGroup.add(thirdAction, new Constraints(BEFORE, "fifthAction"));
defaultActionGroup.add(fourthAction);
defaultActionGroup.add(fifthAction);
defaultActionGroup.add(sixthAction);
// when
Action[] result = defaultActionGroup.getChildren(mock(ActionEvent.class));
// then
assertThat(Arrays.asList(result)).hasSize(6).containsExactly(firstAction, secondAction, fourthAction, thirdAction, fifthAction, sixthAction);
}
Aggregations