Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
#883: Adjusted tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkutz committed Aug 18, 2016
1 parent 444c079 commit 9bf9a0c
Show file tree
Hide file tree
Showing 8 changed files with 1,196 additions and 1,006 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@
* </ul>
* Preconditions:
* <ul>
* <li>Each incoming transition has at least one action.</li>
* <li>No incoming transition enters a composite state which has entry actions.</li>
* <li>At least one action is foldable.</li>
* <li>No incoming transition enters a composite state which has entry actions.</li>
* </ul>
* @author thomas kutz - Initial contribution and API
*
Expand All @@ -60,18 +59,13 @@ protected void internalExecute() {
@Override
public boolean isExecutable() {
return super.isExecutable()
&& allIncomingTransitionsHaveAtLeastOneAction()
&& noIncomingTransitionEntersCompositeWithEntryActions()
&& atLeastOneActionIsFoldable();
&& atLeastOneActionIsFoldable()
&& noIncomingTransitionEntersCompositeWithEntryActions();
}

private boolean noIncomingTransitionEntersCompositeWithEntryActions() {
return !helper.oneIncomingTransitionEntersCompositeWithEntryActions(getContextObject());
}

private boolean allIncomingTransitionsHaveAtLeastOneAction() {
return helper.haveAllAtLeastOneAction(getContextObject().getIncomingTransitions());
}

private boolean atLeastOneActionIsFoldable() {
EList<Transition> transitions = getContextObject().getIncomingTransitions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@
* </ul>
* Preconditions:
* <ul>
* <li>Each outgoing transition has at least one action.</li>
* <li>No outgoing transition leaves a composite state which has exit actions.</li>
* <li>At least one action is foldable.</li>
* <li>No outgoing transition leaves a composite state which has exit actions.</li>
* </ul>
* @author thomas kutz - Initial contribution and API
*
Expand All @@ -60,18 +59,13 @@ protected void internalExecute() {
@Override
public boolean isExecutable() {
return super.isExecutable()
&& allOutgoingTransitionsHaveAtLeastOneAction()
&& noOutgoingTransitionLeavesCompositeWithExitActions()
&& atLeastOneFoldableAction();
&& atLeastOneFoldableAction()
&& noOutgoingTransitionLeavesCompositeWithExitActions();
}

private boolean noOutgoingTransitionLeavesCompositeWithExitActions() {
return !helper.oneOutgoingTransitionLeavesCompositeWithExitActions(getContextObject());
}

private boolean allOutgoingTransitionsHaveAtLeastOneAction() {
return helper.haveAllAtLeastOneAction(getContextObject().getOutgoingTransitions());
}

private boolean atLeastOneFoldableAction() {
EList<Transition> transitions = getContextObject().getOutgoingTransitions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public void testIsExecutable() {

testRefactoringIsExecutableOnState(FOLD_INCOMING_ACTIONS + INITIAL_STATECHART,
FOLD_INCOMING_ACTIONS + EXPECTED_STATECHART, "InnerState", false);

testRefactoringIsExecutableOnState(FOLD_INCOMING_ACTIONS + INITIAL_STATECHART,
FOLD_INCOMING_ACTIONS + EXPECTED_STATECHART, "D", false);
}

protected AbstractRefactoring<?> getRefactoring(State state) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public void testIsExecutable() {

testRefactoringIsExecutableOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "E", false);

testRefactoringIsExecutableOnState(FOLD_OUTGOING_ACTIONS + INITIAL_STATECHART,
FOLD_OUTGOING_ACTIONS + EXPECTED_STATECHART, "F", false);
}

@Override
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 9bf9a0c

Please sign in to comment.