Commit 678f7f51 authored by Faezeh KHORRAM's avatar Faezeh KHORRAM 💬
Browse files

define message verdict

parent 120f2d5d
......@@ -47,6 +47,7 @@ import static extension org.imt.k3tdl.k3dsa.GateInstanceAspect.*
import static extension org.imt.k3tdl.k3dsa.TestDescriptionAspect.*
import static extension org.imt.k3tdl.k3dsa.TestConfigurationAspect.*
import org.etsi.mts.tdl.Target
import org.imt.tdl.testResult.TDLMessageResult
@Aspect (className = BehaviourDescription)
class BehaviourDescriptionAspect{
......@@ -202,6 +203,7 @@ class ProcedureCallAspect extends InteractoinAspect{
}
@Aspect (className = Message)
class MessageAspect extends InteractoinAspect{
private TDLMessageResult messageVerdict;
@Step
@OverrideAspectMethod
def boolean performBehavior(){
......@@ -211,15 +213,15 @@ class MessageAspect extends InteractoinAspect{
if (_self.sourceGate.component.role.toString == "SUT"){
//when the SUT component sends an argument, it is actually an assertion that have to be checked
_self.sourceGate.gate.setLauncher(_self.parentTestDescription.launcher)
var String info = _self.sourceGate.gate.assertArgument(_self.argument)
_self.addMessageResult(info)
var String verdict = _self.sourceGate.gate.assertArgument(_self.argument)
_self.addMessageResult(verdict)
return true //continue test case execution
}else{//the argument has to be sent to the MUT
t.targetGate.gate.setLauncher(_self.parentTestDescription.launcher)
var String info = t.targetGate.gate.sendArgument2sut(_self.argument)
_self.addMessageResult(info)
var String verdict = t.targetGate.gate.sendArgument2sut(_self.argument)
_self.addMessageResult(verdict)
var boolean result = true
if (info.contains("FAIL")){
if (verdict.contains("FAIL")){
result = false
_self.parentTestDescription.testCaseResult.value = "INCONCLUSIVE"//the test case should be interrupted
}
......@@ -237,7 +239,8 @@ class MessageAspect extends InteractoinAspect{
if (info.contains(":")){
message = info.substring(info.indexOf(":") + 2, info.length)
}
_self.parentTestDescription.testCaseResult.addTdlMessage(_self.name, result, !result, message, null)
_self.messageVerdict = new TDLMessageResult(_self.name, result, message, null,!result);
_self.parentTestDescription.testCaseResult.addTdlMessage(_self.messageVerdict)
}
}
@Aspect (className = TimerStart)
......
......@@ -16,6 +16,13 @@ public class TDLMessageResult {
private boolean failure;
public TDLMessageResult(String tdlMessageName, boolean value, String message, HashMap<DataUse, DataUse> oracle, boolean error) {
this.tdlMessageName = tdlMessageName;
this.value = value;
this.message = message;
this.oracle = oracle;
this.failure = error;
}
public String getTdlMessageName() {
if (this.tdlMessageName == null) {
return "NULL";
......
......@@ -70,18 +70,10 @@ public class TDLTestCaseResult {
return failures;
}
public void addTdlMessage(String tdlMessageName, boolean value, boolean error, String message, HashMap<DataUse, DataUse> oracle) {
TDLMessageResult testInfo = new TDLMessageResult();
if (tdlMessageName == null) {
this.messageNumber++;
tdlMessageName = "Message#" + this.messageNumber;
}
testInfo.setTdlMessageName(tdlMessageName);
testInfo.setValue(value);
testInfo.setMessage(message);
testInfo.setOracle(oracle);
testInfo.setFailure(error);
this.tdlMessages.add(testInfo);
public void addTdlMessage(TDLMessageResult messageVerdict) {
this.messageNumber++;
messageVerdict.setTdlMessageName("Message#" + this.messageNumber);
this.tdlMessages.add(messageVerdict);
}
}
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