Commit 9fc5c263 authored by Faezeh KHORRAM's avatar Faezeh KHORRAM 💬
Browse files

update tdl interpreter

parent cb7c6f1d
......@@ -239,7 +239,10 @@ class MessageAspect extends InteractoinAspect{
result = false
_self.parentTestDescription.testCaseResult.value = "FAIL"
}
val message = info.substring(info.indexOf(":") + 2, info.length)
var message = info
if (info.contains(":")){
message = info.substring(info.indexOf(":") + 2, info.length)
}
_self.parentTestDescription.testCaseResult.addTdlMessage(_self.name, result, !result, message, null)
}
}
......
......@@ -23,6 +23,7 @@ import static extension org.imt.k3tdl.k3dsa.DataTypeAspect.*
import java.util.ArrayList
import java.util.Map
import java.util.HashMap
import org.imt.tdl.testResult.TestResultUtil
@Aspect(className=GateType)
class GateTypeAspect {
......@@ -119,7 +120,8 @@ class GateInstanceAspect {
return "PASS: The expected data is equal to the MUT data"
}else{
println("Assertion FAILED: The expected response is not received from MUT")
return "FAIL: The expected data is: " + matchedMUTElements.toString +
var expectedData = TestResultUtil.instance.getDataAsString(matchedMUTElements)
return "FAIL: The expected data is: " + expectedData +
", but the MUT data is: " + _self.gateLauncher.OCLResultAsString;
}
}else{
......
......@@ -36,6 +36,8 @@ import static extension org.imt.k3tdl.k3dsa.MemberAssignmentAspect.*
import static extension org.imt.k3tdl.k3dsa.ParameterBindingAspect.*
import static extension org.imt.k3tdl.k3dsa.StaticDataUseAspect.*
import static extension org.imt.k3tdl.k3dsa.StructuredDataInstanceAspect.*
import org.imt.tdl.testResult.TestResultUtil
import java.util.List
@Aspect (className = DataType)
class DataTypeAspect{
......@@ -286,8 +288,10 @@ class DataInstanceUseAspect extends StaticDataUseAspect{
if ((featureValue as EList).equals(matchedObjects)){
return "PASS: The expected data is equal to the MUT data"
}
return "FAIL: The expected data is: " + (featureValue as EList).toString +
" , but the MUT data is: " + matchedObjects.toString;
val expectedData = TestResultUtil.instance.getDataAsString(featureValue as EList)
val mutData = TestResultUtil.instance.getDataAsString(matchedObjects)
return "FAIL: The expected value for the " + _self.dataInstance.name + " property is: " + expectedData +
", but its current value is: " + mutData;
}else{//there is just one data instance
val matchedObject = _self.getMatchedMUTElement(MUTResource , true, DSLPath)
if (matchedObject == null){
......@@ -296,10 +300,13 @@ class DataInstanceUseAspect extends StaticDataUseAspect{
}else if (matchedObject.equals(featureValue)){
return "PASS: The expected data is equal to the MUT data"
}
return "FAIL: The expected data is: " + featureValue.toString +
" , but the MUT data is: " + matchedObject.toString;
val expectedData = "[" + TestResultUtil.instance.eObjectLabelProvider(featureValue as EObject) + "]"
val mutData = "[" + TestResultUtil.instance.eObjectLabelProvider(matchedObject as EObject) + "]"
return "FAIL: The expected value for the " + _self.dataInstance.name + " property is: " + expectedData +
", but its current value is: " + mutData;
}
}
@OverrideAspectMethod
@Step
def String updateData(Resource MUTResource, EObject object, EStructuralFeature matchedFeature, String DSLPath){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment