Examples of TCGNode


Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

  public static List<TCGNode> getPossibleSourceNodes(
      TCGTransition in_oTransition)
  {
    List<TCGNode> colRetNodes = new ArrayList<TCGNode>();
    TCGNode oOriginallyReferencedNode = in_oTransition.getSourceNode();
    if(oOriginallyReferencedNode instanceof TCGIntermediateNode) {
      TCGIntermediateNode oIntNode = (TCGIntermediateNode)oOriginallyReferencedNode;
      colRetNodes.add(oOriginallyReferencedNode);
      // connection point: add connection point references
      if(!oIntNode.getReferencedConnectionPointReferences().isEmpty()) {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

 
  public static List<TCGNode> getTargetNodes(
      TCGTransition in_oTransition)
  {
    List<TCGNode> colTargetNodes = new ArrayList<TCGNode>();
    TCGNode oTargetNode = in_oTransition.getTargetNode();
    if(oTargetNode instanceof TCGRealNode) {
      TCGRealNode oRealTargetNode = (TCGRealNode)oTargetNode;
      TestCaseGraph oTCG = oRealTargetNode.getSubGraph();
      if(oTCG == null) {
        oTCG = oRealTargetNode.getReferencedSubmachine();
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

      TestCaseGraphHelper in_oTCGHelper,
      TestCaseRegion in_oRegion,
      TCGNode in_oSourceNode,
      TCGTransition in_oOutgoingTransition) throws Exception
  {
    TCGNode oTargetNode = in_oOutgoingTransition.getTargetNode();
   
    TCGTransition oTCGTransition1 =
      in_oTCGHelper.addTransition(in_oSourceNode, oTargetNode);
    oTCGTransition1.getEvents().addAll(in_oOutgoingTransition.getEvents());
    oTCGTransition1.setPrecondition(
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

      TestCaseGraphHelper in_oTCGHelper,
      TestCaseRegion in_oRegion,
      TCGTransition in_oIncomingTransition,
      TCGTransition in_oOutgoingTransition) throws Exception
  {
    TCGNode oSourceNode = in_oIncomingTransition.getSourceNode();
    TCGNode oTargetNode = in_oOutgoingTransition.getTargetNode();
   
    TCGIntermediateNode oNewNode =
      in_oTCGHelper.addIntermediateNode(in_oRegion, TCGNodeType.UNKNOWN);
   
    TCGTransition oTCGTransition1 =
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

      TCGNode in_oSubNode,
      TCGNode in_oSuperNode) {
   
    List<TCGTransition> colTransitions = new ArrayList<TCGTransition>();
   
    TCGNode oTmpNode = in_oSubNode;
   
    while(!oTmpNode.equals(in_oSuperNode)) {
      colTransitions.addAll(oTmpNode.getOutgoingTransitions());
      oTmpNode = TCGNodeHelperClass.getSuperState(oTmpNode);
    }
   
    return colTransitions;   
  }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

    for(TCGTransition oIncomingTransition : in_oIntNode.getIncomingTransitions()) {
      // keep on searching ... not explicitly triggered and no decision node
      if(transitionHasNoEventTrigger(oIncomingTransition) &&
          !(oIncomingTransition.getSourceNode() instanceof TCGIntermediateNode &&
              ((TCGIntermediateNode)oIncomingTransition.getSourceNode()).getNodeType().equals(TCGNodeType.DECISION))) {
        TCGNode oSourceNode = oIncomingTransition.getSourceNode();
        // recursion
        List<List<TCGTransition>> colTmpCompoundTransition =
            getIncomingCompoundTransition(oSourceNode);
        // add the current transition
        for(List<TCGTransition> compoundTransition : colTmpCompoundTransition) {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

              sb.append("      assertEquals(true, " + ConvertTCGOCLExpressionToString.constraintVisitor(oPost.getOriginalExpression()) + ");\n");
          }
        }
      }*/
      //moderate state invariants
      TCGNode oNode = pair.getSecond();
      if(oNode instanceof TCGRealNode){
        TCGRealNode oRealNode = (TCGRealNode) oNode;
        if(oRealNode.getCondition() != null && !oRealNode.getCondition().getConjunctions().isEmpty()){
          sb.append("      assertEquals(true, " + ConvertTCGOCLExpressionToString.constraintVisitor(oRealNode.getCondition().getOriginalExpression()) + ");\n");
        }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

          places = new HashSet<Integer>();
        places.add(new Integer(pathLength));
        amplPathForPost.put(oTran, places);
      }
      //state invariant
      TCGNode oNode = oPair.getSecond();
      if(oNode instanceof TCGRealNode){
        TCGRealNode oRealNode = (TCGRealNode) oNode;
        if(oRealNode.getCondition() != null && !oRealNode.getCondition().getConjunctions().isEmpty()){
          if(oRealNode.getCondition().getOriginalExpression() != null){           
            Set<Integer> places = null;
            if (amplPathForStateInv.containsKey(oRealNode))
              places = amplPathForStateInv.get(oRealNode);
            if (places == null)
              places = new HashSet<Integer>();
            places.add(new Integer(pathLength));
            amplPathForStateInv.put(oRealNode, places);           
          }
        }
      }
     
    }

    StringBuilder sb = new StringBuilder();
    sb.append("param Pathlength := " + pathLength + ";\n");

    //set initial value for which model variables that have initial value
    //sb.append(setInitialValueOfVariables(allModelVariables));
   
    //for pre conditions
    for (Entry<TCGTransition, Set<Integer>> entry : amplPathForPre
        .entrySet()) {
      TCGTransition oTransition = entry.getKey();     
      String s = oTransition.getPreSetName();
      String substitute = s.replaceAll("\\s", "_");     
      sb.append("set " + substitute
          + ":=");
      for (Integer j : entry.getValue()) {
        sb.append(" " + j);
      }
      sb.append(";\n");
    }
    //for post conditions
    for (Entry<TCGTransition, Set<Integer>> entry : amplPathForPost
        .entrySet()) {
      TCGTransition oTransition = entry.getKey()
      String s = oTransition.getPostSetName();
      String substitute = s.replaceAll("\\s", "_");
      sb.append("set " + substitute
          + ":=");
      for (Integer j : entry.getValue()) {
        sb.append(" " + j);
      }
      sb.append(";\n")
    }
    //for state invariant
    for (Entry<TCGNode, Set<Integer>> entry : amplPathForStateInv
        .entrySet()) {     
      TCGNode oNode = entry.getKey();
      String s = oNode.getName();
      String substitute = s.replaceAll("::", "_")
      substitute = substitute.replaceAll("\\s", "_");
      sb.append("set " + substitute
          + ":=");
      for (Integer j : entry.getValue()) {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

  {
    TCGIntermediateNode oNewNode =
      addIntermediateNode(in_oTransition.getContainer(), TCGNodeType.UNKNOWN);
    oNewNode.setNodeType(TCGNodeType.TEMPORARY);
   
    TCGNode oTCGOldTarget = in_oTransition.getTargetNode();
    in_oTransition.setTargetNode(oNewNode);
    oTCGOldTarget.getIncomingTransitions().remove(in_oTransition);
    oNewNode.getIncomingTransitions().add(in_oTransition);
    return addTransition(oNewNode, oTCGOldTarget);
  }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGNode

   * @generated
   */
  protected T doSwitch(int classifierID, EObject theEObject) {
    switch (classifierID) {
      case GeneratedPackage.TCG_NODE: {
        TCGNode tcgNode = (TCGNode)theEObject;
        T result = caseTCGNode(tcgNode);
        if (result == null) result = caseTCGElement(tcgNode);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
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.