Examples of TCGAction


Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGAction

  };

  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);
          }
        }
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.