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;