Commit 9afc9731 authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+added initial support for test description reference (no parameters and


no component bindings yet)
*minor refinements to getMainContext

Change-Id: I1033654a0323804bdf1cefde120d7e47bae54675
Signed-off-by: Philip Makedonski's avatarmakedonski <makedonski@informatik.uni-goettingen.de>
parent d8f3e931
......@@ -487,7 +487,7 @@ rule TD2FD
for (ci in td.testConfiguration.componentInstance.select(c|simulateSUT or c.role = TDL!ComponentInstanceRole#Tester)) {
var cf = new TTCN!FunctionDef();
cf.name = td.TTCNname()+"_"+ci.TTCNname()+"_main";
cf.name = td.getMainContext(ci);
var md = new TTCN!ModuleDefinition();
md.def = cf;
......@@ -1432,9 +1432,14 @@ operation TDL!Interaction execute(sourceContext : TTCN!StatementBlock, targetCon
}
operation TDL!Behaviour getMainContext(component : TDL!ComponentInstance) : String {
return self.getTestDescription().name+"_"+component.name+"_main";
return self.getTestDescription().getMainContext(component);
}
operation TDL!TestDescription getMainContext(component : TDL!ComponentInstance) : String {
return self.TTCNname()+"_"+component.TTCNname()+"_main";
}
operation TDL!AlternativeBehaviour execute() {
if (not transformAlt) return;
var td = self.getTestDescription();
......@@ -1863,6 +1868,31 @@ operation TDL!ActionReference execute() {
}
}
operation TDL!TestDescriptionReference execute() {
//TODO: support parameters (also in initialisation in TD2FD)
//TODO: support bindings
for (ci in self.getTestDescription().testConfiguration.componentInstance.select(c|simulateSUT or c.role = TDL!ComponentInstanceRole#Tester)) {
var sc = self.getMainContext(ci);
var sb = stack.get(sc).last();
var tc = self.testDescription.getMainContext(ci);
var cf = TTCN!FunctionDef.all().select(f|f.name = tc).first();
if (cf.isDefined()) {
var ssl = new TTCN!FunctionStatementList();
var s = new TTCN!FunctionStatement();
s.behavior = new TTCN!BehaviourStatements();
s.behavior.`function` = new TTCN!FunctionInstance();
s.behavior.`function`.ref = cf;
ssl.statements.add(s);
ssl.sc.add(";");
sb.stat.add(ssl);
} else {
(" Could not resolve "+tc).log(1);
//TODO
}
}
}
operation TDL!VerdictAssignment execute() {
for (ci in self.getTestDescription().testConfiguration.componentInstance.select(c|simulateSUT or c.role = TDL!ComponentInstanceRole#Tester)) {
......@@ -1878,8 +1908,6 @@ operation TDL!VerdictAssignment execute() {
sb.stat.add(ssl);
}
}
operation String getVerdictStatement() : TTCN!FunctionStatement {
......
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