Examples of TCGEvent


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

          ((TCGIntermediateNode)oTCGNode).getNodeType().equals(TCGNodeType.TEMPORARY)))
      {
        // create correspondingly a test goal for each outgoing transition
        for(TCGTransition oOutgoingTransition : oTCGNode.getOutgoingTransitions())
        {
          TCGEvent oEvent = null;
          // select just one of the assigned events TODO what about other events?
          if(!oOutgoingTransition.getEvents().isEmpty())
            oEvent = oOutgoingTransition.getEvents().get(0);
         
          Map<TCGNode, List<TestGoalBase>> colTestGoals =
View Full Code Here

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

        Map<TCGNode, List<TestGoalBase>> colTestGoals =
          new LinkedHashMap<TCGNode, List<TestGoalBase>>();
       
        // create corresponding test goals: for each event and each collected condition set
        for(TCGTransition oOutgoingTransition : oTCGNode.getOutgoingTransitions()) {
          TCGEvent oEvent = null;
          if(!oOutgoingTransition.getEvents().isEmpty())
            oEvent = oOutgoingTransition.getEvents().get(0);
         
          TCGDisjunctiveNormalForm oDNF = oOutgoingTransition.getPrecondition();
          {
            if(oDNF == null)
              continue;
           
            // only proceed if the current DNF is intended for test goal creation
            if(!oDNF.isUseForTestGoals())
              continue;
           
            // create test goals for each generated DNF
            for(TCGDisjunctiveNormalForm oTestGoalDNF : in_oCoverageCriterion.createDNFsForTestGoals(oDNF))
            {
              // after creating the test goals: resolve DNF
//              System.out.println("before: " +
//                  TCGDisjunctiveNormalFormHelperClass.toString(
//                      oTestGoalDNF));
              if(TCGDisjunctiveNormalFormHelperClass.allConjunctionsRemovedBecauseOfInfeasibility(
                  oTestGoalDNF)) {
                // invalid test goal
                continue;
              }
              TCGDisjunctiveNormalFormHelperClass.splitUpInequationsInDNF(oTestGoalDNF);
              TCGDisjunctiveNormalFormHelperClass.removeDoubleNots(oTestGoalDNF);
              TCGConjunctionHelperClass.removeContradictingConjunctions(
                oTestGoalDNF.getConjunctions());
              TCGConjunctionHelperClass.removeRedundantExpressionsInConjunctions(
                oTestGoalDNF.getConjunctions());
              TCGConjunctionHelperClass.removeRedundantConjunctions(
                oTestGoalDNF.getConjunctions());
             
              List<TestGoalBase> colGoals = getDefaultCreatedListFromMap(
                  colTestGoals, oTCGNode);
              boolean bTestGoalAdded = createNewTestGoalAndAddToCollection(
                  oTCGNode, oEvent,
                  TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(oTestGoalDNF),
                  in_oCoverageCriterion, colGoals, true);
              if(bTestGoalAdded &&
                  Configuration.getDuplicateTestGoalsForContainedNodes()) {
                for(TCGNode oSubNode : TCGNodeHelperClass.getAllSubNodes(oTCGNode)) {
                  if(oSubNode instanceof TCGRealNode &&
                      TCGNodeHelperClass.getAllTransitionsWithoutTrigger(oSubNode).isEmpty()) {
                    colGoals = getDefaultCreatedListFromMap(colTestGoals, oSubNode);
                    createNewTestGoalAndAddToCollection(
                        oSubNode, oEvent,
                        TCGDisjunctiveNormalFormHelperClass.copyDNFDeep(oTestGoalDNF),
                        in_oCoverageCriterion, colGoals, false);
                  }
                }
              }
            }
          }
        }
       
        // Add test goals for events that are not called from state oTCGNode.
        // There must be at least one outgoing transition with a non-default trigger.
        if(Configuration.isCreateTestGoalsForUncalledEvents()) {
          List<TCGEvent> colTriggeredEvents =
            TCGNodeHelperClass.getTriggeringEventsForNode(oTCGNode);
          boolean bOnlyDefaultTriggers = true;
          for(TCGEvent oEvent : colTriggeredEvents) {
            if(oEvent != null && !oEvent.isDefaultEvent()) {
              bOnlyDefaultTriggers = false;
            }
          }
          if(bOnlyDefaultTriggers == false) {
            for(TCGEvent oEvent : colAllCalledEvents) {
              if(!(oEvent == null || oEvent.isDefaultEvent() ||
                  //colTriggeredEvents.contains(oEvent))) {
                  ObjectComparator.contains(colTriggeredEvents, oEvent))) {
                TestGoalGuardConditions oTestGoal =
                  new TestGoalGuardConditions(oTCGNode, oEvent,
                      TCGDisjunctiveNormalFormHelperClass.createDisjunctiveNormalForm(null, false));
View Full Code Here

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

      }
      if(oTestGoal instanceof TestGoalGuardConditions) {
        TestGoalGuardConditions oTestGoalGuard =
          (TestGoalGuardConditions)oTestGoal;
        TCGNode oNode = (TCGNode)oTestGoalGuard.getElement();
        TCGEvent oEvent = oTestGoalGuard.getEventToBeCalled();
        TCGDisjunctiveNormalForm oDNF = oTestGoalGuard.getDNFToBeSatisfied();

        ArrayList<TCGConjunction> colConjunctionsToTheFront =
          new ArrayList<TCGConjunction>();
        ArrayList<TCGConjunction> colConjunctionsToTheEnd =
View Full Code Here

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

//      }
      if(oTestGoal instanceof TestGoalGuardConditions) {
        TestGoalGuardConditions oTestGoalGuard =
          (TestGoalGuardConditions)oTestGoal;
        TCGNode oNode = (TCGNode)oTestGoalGuard.getElement();
        TCGEvent oEvent = oTestGoalGuard.getEventToBeCalled();
        TCGDisjunctiveNormalForm oDNF = oTestGoalGuard.getDNFToBeSatisfied();

        ArrayList<TCGConjunction> colConjunctionsToTheFront =
          new ArrayList<TCGConjunction>();
        ArrayList<TCGConjunction> colConjunctionsToTheEnd =
View Full Code Here

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

    return m_colTestGoalsToSatisfy;
  }
 
  public boolean isMostRecentCalledEventDefaultEvent() {
    if(!getCurrentTransitionPath().isEmpty()) {
      TCGEvent oEvent = getCurrentTransitionPath()
        .get(getCurrentTransitionPath().size() - 1).getCalledEvent();
      if(oEvent == null || oEvent.isDefaultEvent())
        return true;
    }
    return false;
   
  }
View Full Code Here

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

          TCGTransitionHelperClass.returnAvailableEventsAndGuardsForStateAndOutgoingTransition(
            in_oPair.getFirst(), in_oPair.getSecond());
        // TODO : ### ObjectComparator durchziehen: nach "contains" suchen
        Object oRefObject = ObjectComparator.getEqualObject(colAllowedEventToDNF.keySet(), in_oEvent);
        if(oRefObject != null) {
          TCGEvent oRefEvent = (TCGEvent)oRefObject;
          boolean bBothDNFsAreNonEmpty = !(oPreDNF == null || oPreDNF.getConjunctions().isEmpty())
            && !(colAllowedEventToDNF.get(oRefEvent) == null || colAllowedEventToDNF.get(oRefEvent).getConjunctions().isEmpty());
          oPreDNF = TCGDisjunctiveNormalFormHelperClass.connectTwoDNFWithAnd(
              oPreDNF, colAllowedEventToDNF.get(oRefEvent));
          TCGDisjunctiveNormalFormHelperClass.removeContradictingConjunctions(oPreDNF);
View Full Code Here

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

   */
  public void createMissingParameterInstances()
  {
    for(TransitionInstance oTransitionInstance : m_colTransitionInstances)
    {
      TCGEvent oEvent = oTransitionInstance.getCalledEvent();
      if((oEvent != null) &&
        (oEvent.getParameters() != null) &&
        !(oEvent.getParameters().isEmpty()))
      {
        for(TCGParameter oParameter : oEvent.getParameters())
        {
          boolean bFound = false;
          for(EventParameterInstance oEPInstance : oTransitionInstance.getParameterInstances())
          {
            if(oParameter.equals(oEPInstance.getSuperParameter()))
View Full Code Here

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

   */
  public static TCGEvent createTCGEvent(
      Event in_oSMEvent,
      boolean in_bCreateTCGEventIfEventIsNull) {
   
    TCGEvent oTCGEvent = GeneratedFactory.eINSTANCE.createTCGEvent();
    if(in_oSMEvent != null){
      oTCGEvent.setName(in_oSMEvent.getName());
      oTCGEvent.setEvent(in_oSMEvent);
      oTCGEvent.setDefaultEvent(false);
      if(in_oSMEvent instanceof CallEvent)
      {
        CallEvent oCallEvent = (CallEvent)in_oSMEvent;
        for(Parameter oParameter : oCallEvent.getOperation().getOwnedParameters())
        {
          oTCGEvent.getParameters().add(
              TCGParameterHelperClass.createTCGParameter(oParameter));
        }
      }
    }
    else if(in_bCreateTCGEventIfEventIsNull)
    {
      oTCGEvent.setName(Configuration.getDefaultTransitionName());
      oTCGEvent.setEvent(null);
      oTCGEvent.setDefaultEvent(true);
    }
    else
      oTCGEvent = null;
    return oTCGEvent;
  }
View Full Code Here

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

        T result = caseTCGEquivalenceClass(tcgEquivalenceClass);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCG_EVENT: {
        TCGEvent tcgEvent = (TCGEvent)theEObject;
        T result = caseTCGEvent(tcgEvent);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCGOCL_EXPRESSION: {
View Full Code Here

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

    int in_nCurrentTransitionIndex)
  {
    for(int n = in_nCurrentTransitionIndex; n >= 0; --n)
    {
      TransitionInstance oTransitionInstance = in_oTestCase.getTransitionInstances().get(n);
      TCGEvent oEvent = oTransitionInstance.getCalledEvent();
      if(oEvent != null)
      {
        return oEvent.isDefaultEvent();
      }
    }
    return false;
  }
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.