}
};
public static void addContinuityConstraints(TCGActivity tcgActivity) {
ActivityTestCaseGraphFactory factory = ActivityTestCaseGraphFactory.eINSTANCE;
for (AbstractTCGNode n : tcgActivity.getNodes()) {
TCGAction tcgAct;
EList<TCGBasicVariable> referencedBasicVars = new BasicEList<TCGBasicVariable>();
if (n instanceof TCGAction) {
tcgAct = (TCGAction) n;
// get all Basic Variables, that are already dependent on the
// Postconditions
for (AbstractTCGConstraint c : tcgAct.getLocalPostconditions()) {
referencedBasicVars.addAll(searchHelper.doSwitch(c));
}
// Add Postconditions explicitly stating, that Variables without
// assignment stay the same.
for (TCGVariable var : tcgActivity.getVariables()) {
if (var instanceof TCGBasicVariable && !var.isIsParameter()
&& !referencedBasicVars.contains(var)) {
TCGOCLVariableCallExp pre = factory.createTCGOCLVariableCallExp();
pre.setIsPre(true);
pre.setVariable(var);
pre.setName(var.getName()+"@Pre");
TCGOCLVariableCallExp post = factory.createTCGOCLVariableCallExp();
post.setIsPre(false);
post.setVariable(var);
post.setName(var.getName());
TCGOCLOperationCallExp continuityExp = factory.createTCGOCLOperationCallExp();
continuityExp.setName("continuity");
continuityExp.setOperation(TCGOCLOperationType.EQUALS);
continuityExp.setSource(post);
continuityExp.getArguments().add(pre);
tcgAct.getLocalPostconditions().add(continuityExp);