Examples of TCGOCLAtom


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

  public static String getEnumStringValue(
      TCGOCLExpression in_oTCGOCLExpression,
      Map<TCGOCLAtom, TestCaseValidValue> in_colValueAssignments)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      if(in_colValueAssignments.keySet().contains(oPropExp)) {
        return in_colValueAssignments.get(oPropExp).getValue();
      }
     
      Variable oVar = null;
      if (oPropExp.getElement() instanceof Variable) {
        oVar = (Variable)oPropExp.getElement();
      }
   
      if (oVar != null) {
        // nothing - variables do not have fixed values
      }
      else if (oPropExp.getElement() instanceof Property) {
        Property oProp = (Property) oPropExp.getElement();
        if (oProp.getDefaultValue() == null) {
          throw new Exception("error in getValue() for property "
              + oProp.getName());
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return sValue;
        }
      }
      else if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return oRef.getDefaultValueLiteral();
      }
      else if (oPropExp.getElement() instanceof EnumerationLiteral) {
        EnumerationLiteral oEnum = (EnumerationLiteral)oPropExp.getElement();
        return oEnum.getName();
      }
 
    }
    return null;
View Full Code Here

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

  }

  public static boolean expressionContainsLinearOrderedTypes(TCGOCLExpression in_oExpression) {
    if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      // adding the reference from the atom to the containing transition
      if(oAtom.getElement() instanceof TypedElement) {
        TypedElement oTypedElement = (TypedElement)oAtom.getElement();
        Type oType = oTypedElement.getType();
        List<String> colBasicUnorderedTypeNames = new ArrayList<String>();
        colBasicUnorderedTypeNames.add("int");
        colBasicUnorderedTypeNames.add("integer");
        colBasicUnorderedTypeNames.add("double");
View Full Code Here

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

    TCGOCLExpression oTCGOCLExpression = null;
    if(in_oExpression != null)
    {
      if(in_oExpression instanceof TCGOCLAtom)
      {
        TCGOCLAtom oOldAtom = (TCGOCLAtom)in_oExpression;
        oTCGOCLExpression = copyAtom(oOldAtom);
      }
      else if(in_oExpression instanceof TCGOCLOperation)
      {
        TCGOCLOperation oOldOperation = (TCGOCLOperation)in_oExpression;
View Full Code Here

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

          null, new ArrayList<TCGOCLAtom>());
    if(in_oExpression != null)
    {
      if(in_oExpression instanceof TCGOCLAtom)
      {
        TCGOCLAtom oOldAtom = (TCGOCLAtom)in_oExpression;
        TCGOCLAtom oNewAtom = copyAtom(oOldAtom);
        // update references
        if(in_colReferences.contains(in_oExpression)) {
          oRetValue.getSecond().add(oNewAtom);
        }
        oRetValue.setFirst(oNewAtom);
View Full Code Here

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

    return oRetValue;   
  }

  public static TCGOCLAtom copyAtom(TCGOCLAtom in_oAtom) {
    TCGOCLAtom oNewAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
    oNewAtom.setElement(in_oAtom.getElement());
    oNewAtom.setTcgParameter(in_oAtom.getTcgParameter());
    oNewAtom.setTransitionContext(in_oAtom.getTransitionContext());
    return oNewAtom;
  }
View Full Code Here

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

  {
    ArrayList<TCGOCLExpression> colContradictingExpressions =
      new ArrayList<TCGOCLExpression>();
    TCGOCLVariableClassificator oClassificator =
      new TCGOCLVariableClassificator(in_oExpression);
    TCGOCLAtom oInterestingElement = null;
    EObject oReferredObject = null;
    ValueTypeRange oActualValueRange = null;
   
    // current expression is an operation
    if(in_oExpression instanceof TCGOCLOperation) {
View Full Code Here

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

    ValueTypeRange oGlobalVTR = null;
    boolean bResult = true;
   
    //ATOM: for(TCGOCLAtom oAtom : in_oAtom) {
    if(!in_oAtom.isEmpty()) {
      TCGOCLAtom oAtom = in_oAtom.get(0);
     
      if(oGlobalVTR == null) {
        oGlobalVTR = ValueTypeRangeFactory.createValueTypeRangeForObject(oAtom);
      }
      //hier statt eines �bergebenen atoms eine Liste "gleicher" Atome �berpr�fen???
     
      // get value type range
      ValueTypeRange oVTR = in_colAtomToVTR.get(oAtom);
      if(oVTR != null)
        oVTR = oVTR.clone();
      else
        oVTR = ValueTypeRangeFactory.createValueTypeRangeForObject(oAtom);
     
     
      // TODO Typ von in_colCurrentValueAssignment �ndern auf Map<EObject,TestCaseValidValue>
      // if there is a value assignment for the given atom
      for(TCGOCLAtom oAtomWithAssignedValue : in_colCurrentValueAssignment.keySet()) {
        if(oAtomWithAssignedValue.getElement().equals(oAtom.getElement())) {
          // adapt value type range
          bResult = bResult &&
            oVTR.adaptRange(in_colCurrentValueAssignment.get(oAtomWithAssignedValue).getValue());
          bResult = bResult &&
            oGlobalVTR.adaptRange(oVTR);
View Full Code Here

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

      TCGOCLExpression in_oCheckedExpression,
      TCGOCLExpression in_oWarrantedExpression) {
    // compare atoms
    if(in_oCheckedExpression instanceof TCGOCLAtom &&
        in_oWarrantedExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oCheckedAtom = (TCGOCLAtom)in_oCheckedExpression;
      TCGOCLAtom oWarrantedAtom = (TCGOCLAtom)in_oWarrantedExpression;
      return oCheckedAtom.getElement().equals(oWarrantedAtom.getElement());
    }
    // compare operations
    else if(in_oCheckedExpression instanceof TCGOCLOperation &&
        in_oWarrantedExpression instanceof TCGOCLOperation) {
      OCLTreeTCGOCLAtomCollectorVisitor oFirstCollector =
        new OCLTreeTCGOCLAtomCollectorVisitor();
      OCLTreeTCGOCLAtomCollectorVisitor oSecondCollector =
        new OCLTreeTCGOCLAtomCollectorVisitor();
      OCLTreeExpressionIterator.run(in_oCheckedExpression, oFirstCollector);
      OCLTreeExpressionIterator.run(in_oWarrantedExpression, oSecondCollector);
 
      // try to adapt both sides to each other
      TCGOCLAtom oFirstAtom = oFirstCollector.getExpressions().get(0);
      TCGOCLAtom oSecondAtom = null;
      for(TCGOCLAtom oTmpAtom : oSecondCollector.getExpressions()) {
        if(expressionsContainReferenceToTheSameObject(
            oFirstAtom, oTmpAtom)) {
//        if(oFirstAtom.getElement().equals(oTmpAtom.getElement())) {
          oSecondAtom = oTmpAtom;
View Full Code Here

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

        if (result == null) result = caseTCGOCLExpression(tcgoclOperation);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GeneratedPackage.TCGOCL_ATOM: {
        TCGOCLAtom tcgoclAtom = (TCGOCLAtom)theEObject;
        T result = caseTCGOCLAtom(tcgoclAtom);
        if (result == null) result = caseTCGOCLExpression(tcgoclAtom);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
View Full Code Here

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

  {
    if(in_oExpression != null)
    {
      TCGOCLVariableClassificator oClassificator = new TCGOCLVariableClassificator(in_oExpression);
      TCGOCLExpression oExpression = oClassificator.getClassifiedElementInExpression(VariableClassification.INPUT_PARAMETER);
      TCGOCLAtom oAtom = (TCGOCLAtom)oExpression;
      if(oAtom != null)
      {
        for(TCGParameter oParameter : in_oTCGEvent.getParameters())
        {
          // reference of parameter needs to be equal to
          // the represented parameter of the variable of the ocl reference of the atom
          VariableExp oVarExp = TestCaseGraphHelper.getVariableExp((OCLExpression)oAtom.getOclReference());
          if(oParameter.getReference().equals(oVarExp.getReferredVariable().getRepresentedParameter()))
          {
            if(oAtom.getOclReference() instanceof PropertyCallExp)
            {
              // find sub-parameter corresponding to the referenced property
              TCGParameter oParam = TCGParameterHelperClass.findParameterElementMatchingToReference(
                  oParameter, ((PropertyCallExp)oAtom.getOclReference()).getReferredProperty());
              if(oParam != null)
                oAtom.setTcgParameter(oParam);
              else
                oAtom.setTcgParameter(oParameter);
            }
            else
              oAtom.setTcgParameter(oParameter);
          }
        }
      }
    }
  }
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.