Package net.sf.parteg.base.testcasegraph.generated

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


        if(colElements != null) {
          // evaluate all found references
          for(TCGElement oElement : colElements)
          {
            TestCaseRegion oRegion = null;
            TCGRealNode oNode = null;
            TCGTransition oTransition = null;
           
            if(oElement instanceof TCGRealNode)
            {
              oNode = (TCGRealNode)oElement;
              oRegion = oNode.getContainer();
            }
            else if(oElement instanceof TCGTransition)
            {
              oTransition = (TCGTransition)oElement;
              oRegion = oTransition.getContainer();
View Full Code Here


           LinkedList<Pair<TCGTransition, TCGNode>> adjancentNodesAndTransitions =
               new LinkedList<Pair<TCGTransition, TCGNode>>();
          
         //Check final state of composite state
           if(currentPath.getLast().getSecond().getOriginalNode() instanceof FinalState && modelDepth > 0){
          TCGRealNode oCompositeState = TCGNodeHelperClass.getSuperState(currentPath.getLast().getSecond());
          for (TCGTransition oTran : oCompositeState.getOutgoingTransitions()) {
              if (numberOfNodeInList(visitedNodeByAlgorithm, oTran.getTargetNode())  <= numberOfAllowedIteration){
                adjancentNodesAndTransitions.add(new Pair<TCGTransition, TCGNode>(oTran, oTran.getTargetNode()));
               }
          }
         }
View Full Code Here

                    depthFirst(currentPath);
                 }
               }
               else if(oPair.getSecond() instanceof TCGRealNode) { //the type of node is vertex
                
                  TCGRealNode oTR = (TCGRealNode) oPair.getSecond();
                  TestCaseGraph subGraph = oTR.getSubGraph();
                  if(subGraph == null)
                    subGraph = oTR.getReferencedSubmachine();
                 
                  if(subGraph != null) { //node is composite state (1)
                    modelDepth++;
                       for (TestCaseRegion oRegion : subGraph.getRegions()) {
                      for (TCGIntermediateNode oInitNode : TCGRegionHelperClass.findInitialNodes(oRegion)) {
View Full Code Here

      result.append("\n");
    }
    result.append("\n");
    for (TCGNode oNode : sm.getAllNodes()){
      if(oNode instanceof TCGRealNode){
        TCGRealNode oRealNode = (TCGRealNode) oNode;
        if(oRealNode.getCondition() != null && !oRealNode.getCondition().getConjunctions().isEmpty()){
          if(oRealNode.getCondition().getOriginalExpression() != null){
            result.append(ConvertToAMPL.stateToAMPL(oRealNode));
            result.append("\n");
          }
        }
      }
View Full Code Here

 
  private static boolean compareToUpperRegion(
      TestCaseRegion in_oCurrent,
      TestCaseRegion in_oRegion1,
      TestCaseRegion in_oRegion2) {
    TCGRealNode oNode = in_oCurrent.getContainer().getCompositeSuperState();
    if(oNode != null) {
      TestCaseRegion oTmp = oNode.getContainer();
      if(oTmp.equals(in_oRegion2))
        return true;
      if(!oTmp.equals(in_oRegion1)) {
        if(compareToUpperRegion(oTmp, in_oRegion1, in_oRegion2) == true)
          return true;
View Full Code Here

      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();
      }
      if(oTCG != null) {
        for(TestCaseRegion oRegion : oTCG.getRegions()) {
          colTargetNodes.addAll(TCGRegionHelperClass.findInitialNodes(oRegion));
        }
View Full Code Here

        }
      }*/
      //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

        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>();
View Full Code Here

    return colEvents;
  }
 
  public TCGRealNode addRealNode(TestCaseRegion in_oRegion)
  {
    TCGRealNode oNode = GeneratedFactory.eINSTANCE.createTCGRealNode();
    in_oRegion.getNodes().add(oNode);
    oNode.setContainer(in_oRegion);
    return oNode;
  }
View Full Code Here

  }

  private void replaceInitialNodesWithConnectionPointsInRegion(TestCaseRegion in_oRegion) {
    for(TCGNode oNode : in_oRegion.getNodes()) {
      if(oNode instanceof TCGRealNode) {
        TCGRealNode oRealNode = (TCGRealNode)oNode;
        TestCaseGraph oSubGraph = oRealNode.getSubGraph();
        if(oSubGraph != null) {
          // check all sub-regions
          // TODO parallel sub-regions!!!
          if(!oSubGraph.getRegions().isEmpty()) {
            TestCaseRegion oSubRegion = oSubGraph.getRegions().get(0);
            List<TCGIntermediateNode> colInitialNodes = TCGRegionHelperClass.findInitialNodes(oSubRegion);
            if(!colInitialNodes.isEmpty()) {
              // each region is allowed to have at most one initial node
              TCGIntermediateNode oInitialNode = colInitialNodes.get(0);
              // convert initial node into connection point
              oInitialNode.setNodeType(TCGNodeType.ENTRY);
              oInitialNode.setContainer(oRealNode);
              oRealNode.getContainedConnectionPoints().add(oInitialNode);
              oInitialNode.setOriginalNode(null);
              oInitialNode.setUseAllTransitionsInParallel(true);
              // outgoing transitions are the same ...
              // change all incoming transitions of the composite state
              for(TCGTransition oTransition : oRealNode.getIncomingTransitions()) {
                oTransition.setTargetNode(oInitialNode);
                oInitialNode.getIncomingTransitions().add(oTransition);
              }
              oRealNode.getIncomingTransitions().clear();
            }
            // recursion
            replaceInitialNodesWithConnectionPointsInRegion(oSubRegion);
          }
        }
View Full Code Here

TOP

Related Classes of net.sf.parteg.base.testcasegraph.generated.TCGRealNode

Copyright © 2018 www.massapicom. 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.