Examples of TCGNode


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

 
  public static boolean firstNodeIsSubStateOfSecondNode(
      TCGNode in_oFirstNode, TCGNode in_oSecondNode) {
   
    List<TCGNode> colTmpNodes = new ArrayList<TCGNode>()
    TCGNode oTmpNode = TCGNodeHelperClass.getSuperState(in_oFirstNode);
    if(oTmpNode != null)
    colTmpNodes.add(oTmpNode);
    while(!colTmpNodes.isEmpty())
    {
      List<TCGNode> colTmpSuperNodes = new ArrayList<TCGNode>();
      for(TCGNode oNode : colTmpNodes)
      {
        if(oNode.equals(in_oSecondNode))
          return true;
        TCGNode oSuperNode = TCGNodeHelperClass.getSuperState(oNode);
        if(oSuperNode != null && !colTmpNodes.contains(oSuperNode)) {
          colTmpSuperNodes.add(oSuperNode);
        }
      }
      colTmpNodes = colTmpSuperNodes;
View Full Code Here

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

      nOldSize = nNewSize;
      TestCaseGraph oTCG = getContainingTestGraph(in_oNode);
      if(oTCG != null) {
       
        // check all super states
        TCGNode oNode = oTCG.getCompositeSuperState();
        if(!out_colNodes.contains(oNode) && oNode != null)
          out_colNodes.add(oNode);
       
        // check for referenced states (via connectionpointreferences)
        for(TCGIntermediateNode oConnectionNode : oTCG.getContainedConnectionPoints()) {
View Full Code Here

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

  }
 
  public static TCGNode copyNodeWithoutTransitions(
      TestCaseGraphHelper in_oTCGHelper,
      TCGNode in_oNode) {
    TCGNode oCopy = null;
    if(in_oNode instanceof TCGRealNode) {
      TCGRealNode oOriginal = (TCGRealNode)in_oNode;
      TCGRealNode oRealNode = in_oTCGHelper.addRealNode(oOriginal.getContainer());
      oRealNode.setCondition(
          TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(oOriginal.getCondition()));
      oRealNode.setContainer(oOriginal.getContainer());
      oRealNode.setSubGraph(oOriginal.getSubGraph());
      oCopy = oRealNode;
    }
    else if(in_oNode instanceof TCGIntermediateNode) {
      TCGIntermediateNode oOriginal = (TCGIntermediateNode)in_oNode;
      TCGIntermediateNode oIntNode =
        in_oTCGHelper.addIntermediateNode(
            oOriginal.getContainer(), oOriginal.getNodeType());
//      oIntNode.setContainer(oOriginal.getContainer());
//      oIntNode.setNodeType(oOriginal.getNodeType());
      oIntNode.getReferencedConnectionPointReferences().addAll(
          oOriginal.getReferencedConnectionPointReferences());
      oIntNode.getReferencedConnectionPoints().addAll(
          oOriginal.getReferencedConnectionPoints());
      oCopy = oIntNode;
    }
   
    if(oCopy != null) {
      oCopy.setMaxDistanceFromStart(in_oNode.getMaxDistanceFromStart());
      oCopy.setMinDistanceFromStart(in_oNode.getMinDistanceFromStart());
      oCopy.setName(in_oNode.getName());
      oCopy.setOriginalNode(in_oNode.getOriginalNode());
      oCopy.setReferencedSubmachine(in_oNode.getReferencedSubmachine());
      oCopy.setUseAllTransitionsInParallel(in_oNode.isUseAllTransitionsInParallel());
    }
    return oCopy;
  }
View Full Code Here

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

    // create all the node copies for each compound transition
    for(List<TCGTransition> compoundTransition : colCompoundTransitions) {
      Map<TCGNode, TCGNode> colOriginalToCopy = new LinkedHashMap<TCGNode, TCGNode>();
      for(TCGTransition oCurrentTransition : compoundTransition) {
        TCGNode oNodeToDuplicate = oCurrentTransition.getTargetNode();
       
        // mark the visited target node
        colDispensableNodes.add(oNodeToDuplicate);
       
        // create a copy of the referenced target node
        TCGNode oCopy = TCGNodeHelperClass.copyNodeWithoutTransitions(
            m_oTCGHelper, oNodeToDuplicate);
        colOriginalToCopy.put(oNodeToDuplicate, oCopy);
        if(!oNodeToDuplicate.equals(in_oIntNode) &&
            in_colOtherDecisionNodes.contains(oNodeToDuplicate) &&
            oCopy instanceof TCGIntermediateNode) {
          in_colOtherDecisionNodes.add((TCGIntermediateNode)oCopy);
        }
      }
      colCompoundTransitionNodeCopies.add(colOriginalToCopy);

      // collect all the transitions to create copies for
      List<TCGTransition> colMarkedTransitions = new ArrayList<TCGTransition>();
      colTransitionsMarkedToCopy.put(colOriginalToCopy, colMarkedTransitions);
      // mark all transitions of the compound transition
      colTransitionsMarkedToCopy.get(colOriginalToCopy).addAll(compoundTransition);
      // if the set of incoming transitions does not contain a transition of the
      // found compound transition - then add all outgoing transitions
      for(TCGNode oOriginalNode : colOriginalToCopy.keySet()) {
        boolean bContainsElementOfCompound = false;
        for(TCGTransition oOutgoingTransition : oOriginalNode.getOutgoingTransitions()) {
          if(compoundTransition.contains(oOutgoingTransition))
            bContainsElementOfCompound = true;
        }
        if(bContainsElementOfCompound == false)
          colTransitionsMarkedToCopy.get(colOriginalToCopy).addAll(
              oOriginalNode.getOutgoingTransitions());
//        for(TCGTransition oIncomingTransition : oOriginalNode.getIncomingTransitions()) {
//          colTransitionsMarkedToCopy.get(colOriginalToCopy).add(oIncomingTransition);
//        }
      }
    }
   
    // create the transition copies
    for(Map<TCGNode, TCGNode> colOriginalToCopy : colCompoundTransitionNodeCopies) {
      for(TCGNode oOriginalNode : colOriginalToCopy.keySet()) {
        // copy all outgoing transitions
        for(TCGTransition oOutgoingTransition : oOriginalNode.getOutgoingTransitions()) {
          if(colTransitionsMarkedToCopy.get(colOriginalToCopy).contains(oOutgoingTransition)) {
            TCGNode oTargetNode = colOriginalToCopy.get(oOutgoingTransition.getTargetNode());
            if(oTargetNode == null)
              oTargetNode = oOutgoingTransition.getTargetNode();
            TCGTransitionHelperClass.copyTransitionValuesToNewTransition(
                m_oTCGHelper, oOutgoingTransition,
                colOriginalToCopy.get(oOriginalNode), oTargetNode);
View Full Code Here

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

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setSourceNode(TCGNode newSourceNode) {
    TCGNode oldSourceNode = sourceNode;
    sourceNode = newSourceNode;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GeneratedPackage.TCG_TRANSITION__SOURCE_NODE, oldSourceNode, sourceNode));
  }
View Full Code Here

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

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setTargetNode(TCGNode newTargetNode) {
    TCGNode oldTargetNode = targetNode;
    targetNode = newTargetNode;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GeneratedPackage.TCG_TRANSITION__TARGET_NODE, oldTargetNode, targetNode));
  }
View Full Code Here

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

    }
   
    // last transition instance and still no event found -> check the outgoing transitions of the test case's last node
    TransitionInstance oTransitionInstance = in_oTestCase.getTransitionInstances().get(
        in_oTestCase.getTransitionInstances().size() - 1);
    TCGNode oLastNode = oTransitionInstance.getTargetNode();
    for(TCGTransition oOutgoingTransition : TCGNodeHelperClass.getOutgoingTransitions(oLastNode)) {
      if(oOutgoingTransition.isCanBeProcessed()) {
        for(TCGEvent oEvent : oOutgoingTransition.getEvents()) {
          if (oEvent.isDefaultEvent() &&
            TCGTransitionInstanceHelperClass.checkSatisfactionOfCondition(
View Full Code Here

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

    m_oOptions.put(XMLResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);

    // create TestCaseGraphTree
    m_oTCG = GeneratedFactory.eINSTANCE.createTestCaseGraph();
    // insert initial root node
    TCGNode oRootNode = GeneratedFactory.eINSTANCE.createTCGNode();
    oRootNode.setDistanceToRoot(0);
    m_oTCG.getNodes().add(oRootNode);
    m_oTCG.setRoot(oRootNode);

    m_nActualStateMachineDepth = 0;
    m_oHistory = new SystemModelStateHistory();
View Full Code Here

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

    return m_oTCG.getRoot();
  }
 
  public TCGNode addNode()
  {
    TCGNode oNode = GeneratedFactory.eINSTANCE.createTCGNode();
    m_oTCG.getNodes().add(oNode);
    return oNode;
  }
View Full Code Here

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

    }
  }
 
  public void removeTransition(TCGTransition in_oTransition)
  {
    TCGNode oNode = in_oTransition.getTargetNode();
    if(oNode != null)
    {
      removeNode(oNode);
    }
   
    oNode = in_oTransition.getSourceNode();
    if(oNode != null)
    {
      oNode.getOutgoingTransitions().remove(in_oTransition);
      in_oTransition.setSourceNode(null);
    }

    if(m_oTCG.getTransitions().contains(in_oTransition))
      m_oTCG.getTransitions().remove(in_oTransition);
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.