Examples of TCGOCLAtom


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

          " " + oOp.getOperationName() + " " +
          toString(oOp.getRight()) + ")");
    }
    else if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      if(oAtom.getElement() instanceof BooleanLiteralExp) {
        sRetValue.append(((BooleanLiteralExp)oAtom.getElement()).toString());
      }
      else if(oAtom.getElement() instanceof IntegerLiteralExp) {
        sRetValue.append(((IntegerLiteralExp)oAtom.getElement()).toString());
      }
      else {
        sRetValue.append(((NamedElement)oAtom.getElement()).getName());
      }
    }
    return sRetValue.toString();
  }
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;
        TCGOCLAtom oNewAtom = GeneratedFactory.eINSTANCE.createTCGOCLAtom();
        oNewAtom.setElement(oOldAtom.getElement());
        oNewAtom.setTcgParameter(oOldAtom.getTcgParameter());
        oTCGOCLExpression = oNewAtom;
      }
      else if(in_oExpression instanceof TCGOCLOperation)
      {
        in_oExpression = TCGOCLExpressionHelperClass.removeDoubleNots(in_oExpression);
View Full Code Here

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

   * return an interpretation as a double value
   */ 
  public static double getDoubleValue(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      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 Double.valueOf(sValue).doubleValue();
        }
      }
      if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return Double.valueOf(oRef.getDefaultValueLiteral());
      }
      if (oPropExp.getElement() instanceof RealLiteralExp) {
        RealLiteralExp oRealExp = (RealLiteralExp) oPropExp.getElement();
        return oRealExp.getRealSymbol();
      }
    } else if (in_oTCGOCLExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oTCGOCLExpression;
      if (oOpExp.getOperationName().compareTo("+") == 0) {
View Full Code Here

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

      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 Double.valueOf(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 Double.valueOf(sValue).doubleValue();
        }
      }
      if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return Double.valueOf(oRef.getDefaultValueLiteral());
      }
      if (oPropExp.getElement() instanceof RealLiteralExp) {
        RealLiteralExp oRealExp = (RealLiteralExp) oPropExp.getElement();
        return oRealExp.getRealSymbol();
      }
    } else if (in_oTCGOCLExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oTCGOCLExpression;
      if (oOpExp.getOperationName().compareTo("+") == 0) {
View Full Code Here

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

   * return an interpretation as a integer value
   */ 
  public static Integer getIntegerValue(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      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) {
          // nothing ... system attributes do not have to have fixed values, too
//          throw new Exception("error in getValue() for property "
//              + oProp.getName());
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return Integer.valueOf(sValue).intValue();
        }
      }
      if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return Integer.valueOf(oRef.getDefaultValueLiteral());
      }
      if (oPropExp.getElement() instanceof IntegerLiteralExp) {
        IntegerLiteralExp oIntExp = (IntegerLiteralExp) oPropExp.getElement();
        return oIntExp.getIntegerSymbol();
      }     
    } else if (in_oTCGOCLExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oTCGOCLExpression;
      if (oOpExp.getOperationName().compareTo("+") == 0) {
View Full Code Here

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

  public static Integer getIntegerValue(
      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 Integer.valueOf(in_colValueAssignments.get(oPropExp).getValue());
      }

      return getIntegerValue(in_oTCGOCLExpression);
View Full Code Here

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

    Pair<Integer, Integer> oRetValuePair = null;
    if(in_oTCGOCLExpression == null) {
      // nothing
    }
    else if(in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oTCGOCLExpression;
      // TODO: eindeutige Referenz zwischen zwei Atoms, die das gleiche Objekt referenzieren
      // schaffen -> sonst Probleme bei mehreren gleichen Parameterverwendungen in einer group
      //if(in_colCurrentValueRanges.keySet().contains(in_oTCGOCLExpression)) {
      boolean bFound = false;
      for(TCGOCLAtom oFixedAtom : in_colCurrentValueRanges.keySet()) {
        if(oFixedAtom.getElement().equals(oAtom.getElement())) {
          oRetValuePair = new Pair<Integer, Integer>(
              ((IntegerValueType)(in_colCurrentValueRanges.get(oFixedAtom).getFirst())).getValue(),
              ((IntegerValueType)(in_colCurrentValueRanges.get(oFixedAtom).getSecond())).getValue()
              );   
          bFound = true;
View Full Code Here

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

   * return an interpretation as a boolean value
   */
  public static boolean getBooleanValueIfNegative(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      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());
          // if only a boolean element is referenced, then the meaning is "= true"
          return true;
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return Boolean.parseBoolean(sValue);
        }
      }
      if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return Boolean.parseBoolean(oRef.getDefaultValueLiteral());
      }
      if (oPropExp.getElement() instanceof BooleanLiteralExp) {
        BooleanLiteralExp oBLExp = (BooleanLiteralExp) oPropExp.getElement();
        return oBLExp.getBooleanSymbol();
      }
    }
    else if (in_oTCGOCLExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oTCGOCLExpression;
View Full Code Here

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

      TCGOCLExpression in_oTCGOCLExpression,
      Map<TCGOCLAtom, TestCaseValidValue> in_colCurrentValueAssignment)
      throws Exception {
   
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      // look if there is an externally predefined value
      if(in_colCurrentValueAssignment.keySet().contains(oPropExp)) {
        return !(in_colCurrentValueAssignment.get("oPropExp").getValue()
            .equals("false"));         
      }

      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) {
          // if only a boolean element is referenced, then the meaning is "= true"
          return true;
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return Boolean.parseBoolean(sValue);
        }
      }
      if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
        return Boolean.parseBoolean(oRef.getDefaultValueLiteral());
      }
      if (oPropExp.getElement() instanceof BooleanLiteralExp) {
        BooleanLiteralExp oBLExp = (BooleanLiteralExp) oPropExp.getElement();
        return oBLExp.getBooleanSymbol();
      }
    }
    else if (in_oTCGOCLExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation) in_oTCGOCLExpression;
View Full Code Here

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

   * return an interpretation as a boolean value
   */
  public static String getEnumStringValue(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      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
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.