Examples of TCGRealNode


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

  private void replaceFinalStatesWithConnectionPointsInRegion(
      TestCaseRegion in_oRegion) {
    for(TCGNode oNode : in_oRegion.getNodes()) {
      if(oNode instanceof TCGRealNode) {
        TCGRealNode oRealNode = (TCGRealNode)oNode;
        List<TCGTransition> colSuperTransitions =
          TCGTransitionHelperClass.getDefaultTriggeredOutgoingTransitions(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);
            if(!colSuperTransitions.isEmpty()) {
              List<TCGNode> colEndNodes = TCGRegionHelperClass.findNodesWithOutOutgoingTransitions(oSubRegion);
              // create outgoing connection point
              TCGIntermediateNode oOutNode = GeneratedFactory.eINSTANCE.createTCGIntermediateNode();
              oOutNode.setOriginalNode(null);
              oOutNode.setUseAllTransitionsInParallel(true);
              oRealNode.getContainedConnectionPoints().add(oOutNode);
              oOutNode.setContainer(oRealNode);
              // create additional connection to outgoing node
              for(TCGNode oEndNode : colEndNodes) {
                try {
                  addTransition(oEndNode, oOutNode);
                } catch (Exception e) {
                  Configuration.handleException(e);
                }
              }
              // redirect outgoing transitions of super node without triggers
              for(TCGTransition oSuperTransition : colSuperTransitions) {
                oSuperTransition.setSourceNode(oOutNode);
                oRealNode.getOutgoingTransitions().remove(oSuperTransition);
              }
            }
            // recursion
            replaceFinalStatesWithConnectionPointsInRegion(oSubRegion);
          }
View Full Code Here

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

    boolean bOneStateWasFlattened = true;
    while(bOneStateWasFlattened) {
      bOneStateWasFlattened = false;
      for(TCGNode oNode : in_oRegion.getNodes()) {
        if(oNode instanceof TCGRealNode) {
          TCGRealNode oRealNode = (TCGRealNode)oNode;
          if(!m_AlreadyFlattenedRealNodes.contains(oRealNode)) {
            if(flattenRealNode(oRealNode)) {
              m_AlreadyFlattenedRealNodes.add(oRealNode);
              colRealNodes.add(oRealNode);
              bOneStateWasFlattened = true;
View Full Code Here

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

   
    if(in_oNode instanceof TCGIntermediateNode) {
      TCGIntermediateNode oIntNode = (TCGIntermediateNode)in_oNode;
      if(oIntNode.getNodeType().equals(TCGNodeType.ENTRY)) {
        // determining the super state
        TCGRealNode oSuperNode = null;
        if(oIntNode.getContainer() instanceof TCGRealNode)
          oSuperNode = (TCGRealNode)oIntNode.getContainer();
        else if(oIntNode.getContainer() instanceof TestCaseRegion) {
          TestCaseRegion oRegion = (TestCaseRegion)oIntNode.getContainer();
          if(oRegion.getContainer() != null)
            oSuperNode = (TCGRealNode)oRegion.getContainer().getCompositeSuperState();
        }
        int nRealNodeCounter = searchForMinDistanceFromNode(
            oSuperNode, in_nCounter);
        return Math.max(in_nCounter, nRealNodeCounter);
      }
      // stop at exit nodes
      if(oIntNode.getNodeType().equals(TCGNodeType.EXIT)) {
        return in_nCounter + 1;
      }
    }
    // in_oNode could have changed value
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oRealNode = (TCGRealNode)in_oNode;
      TestCaseGraph oSubGraph = oRealNode.getSubGraph();
      if(oSubGraph != null) {
        for(TestCaseRegion oRegion : oSubGraph.getRegions()) {
          int nRegionCounter = searchForMinDistanceInRegion(
              oRegion, in_nCounter);
          if(nRegionCounter > nMaxCounter)
            nMaxCounter = nRegionCounter;
        }
      }
       
      TestCaseGraph oRefSubGraph = oRealNode.getReferencedSubmachine();
      if(oRefSubGraph != null) {
        System.err.println("BasicDistanceSetter does not support referenced submachines");
      }
    }
   
View Full Code Here

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

        return in_nCounter + 1;
      }
    }
    // in_oNode could have changed value
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oRealNode = (TCGRealNode)in_oNode;
      TestCaseGraph oSubGraph = oRealNode.getSubGraph();
      if(oSubGraph != null) {
        for(TestCaseRegion oRegion : oSubGraph.getRegions()) {
          int nRegionCounter = searchForMaxDistanceInRegion(
              oRegion, in_nCounter, in_colVisitedNodes);
          if(nRegionCounter > nMaxCounter)
            nMaxCounter = nRegionCounter;
        }
      }
       
      TestCaseGraph oRefSubGraph = oRealNode.getReferencedSubmachine();
      if(oRefSubGraph != null) {
        System.err.println("BasicDistanceSetter does not support referenced submachines");
      }
    }
   
View Full Code Here

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

          + in_oNode.getMaxDistanceFromStart()
          + ") for node >"
          + in_oNode.getName() + "<");
    }
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oRealNode = (TCGRealNode)in_oNode;
      List<TCGNode> colNodes = new ArrayList<TCGNode>();
      colNodes.addAll(oRealNode.getContainedConnectionPoints());
      colNodes.addAll(oRealNode.getContainedConnectionPointReferences());
      for(TCGNode oNode : colNodes) {
        checkNode(oNode);
      }
      if(oRealNode.getSubGraph() != null)
        checkTCG(oRealNode.getSubGraph());
      if(oRealNode.getReferencedSubmachine() != null)
        checkTCG(oRealNode.getReferencedSubmachine());
    }
  }
View Full Code Here

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

  public static List<TCGIntermediateNode> getInitialNodesOfState(TCGNode in_oCompositeNode) {
    List<TCGIntermediateNode> colIntNodes = new ArrayList<TCGIntermediateNode>();
   
    if(in_oCompositeNode instanceof TCGRealNode) {
      TCGRealNode oRealNode = (TCGRealNode)in_oCompositeNode;
      TestCaseGraph oSubGraph = oRealNode.getSubGraph();
      if(oSubGraph != null) {
        for(TestCaseRegion oRegion : oSubGraph.getRegions()) {
          for(TCGNode oNode : oRegion.getNodes()) {
            if(oNode instanceof TCGIntermediateNode) {
              TCGIntermediateNode oIntMedNode = (TCGIntermediateNode)oNode;
View Full Code Here

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

  // returns all transitions that are leading to this node (also via connection points, ...)
  public static List<TCGTransition> getAllIncomingTransitionsPlusCPR(TCGNode in_oNode)
  {
    List<TCGTransition> colRetValues = getIncomingTransitions(in_oNode);
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oRealNode = (TCGRealNode)in_oNode;
      for(TCGIntermediateNode oConnectionPoint : oRealNode.getContainedConnectionPoints()) {
        if(oConnectionPoint.getNodeType().equals(TCGNodeType.ENTRY))
          colRetValues.addAll(oConnectionPoint.getIncomingTransitions());
      }
    }   
   
View Full Code Here

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

  // returns all transitions that are leaving from this node (also via connection points, ...)
  public static List<TCGTransition> getAllOutgoingTransitionsPlusCPR(TCGNode in_oNode)
  {
    List<TCGTransition> colRetValues = getOutgoingTransitions(in_oNode);
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oRealNode = (TCGRealNode)in_oNode;
      for(TCGIntermediateNode oConnectionPoint : oRealNode.getContainedConnectionPoints()) {
        if(oConnectionPoint.getNodeType().equals(TCGNodeType.EXIT))
          colRetValues.addAll(oConnectionPoint.getIncomingTransitions());
      }
    }   
   
View Full Code Here

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

        ((TCGIntermediateNode)in_oNode).getNodeType().equals(TCGNodeType.INITIAL)) {
      List<TCGTransition> colRetValues = new ArrayList<TCGTransition>();
      TCGIntermediateNode oNode = (TCGIntermediateNode)in_oNode;
      if(oNode.getNodeType().equals(TCGNodeType.INITIAL)) {
       
        TCGRealNode oSuperNode = getSuperState(oNode);
        if(oSuperNode != null) {
          colRetValues.addAll(oSuperNode.getIncomingTransitions());
        }
        else if(in_oNode instanceof TCGIntermediateNode) {
          for(TCGIntermediateNode oIntNode : ((TCGIntermediateNode)in_oNode).getReferencedConnectionPointReferences()) {
            colRetValues.addAll(oIntNode.getIncomingTransitions());
          }
View Full Code Here

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

    colRetValues.addAll(in_oNode.getOutgoingTransitions());
   
    // add transitions of super states if they are triggered by a real event
    // if they are default-triggered then just add if node has no outgoing transitions
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oNode = (TCGRealNode)in_oNode;
      boolean bNodeHasNoOutgoingTransitions = in_oNode.getOutgoingTransitions().isEmpty();
     
      // all super states (hierarchical)
      for(TCGRealNode oSuperNode : getSuperStates(oNode)) {
        for(TCGTransition oTransition : oSuperNode.getOutgoingTransitions()) {
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.