Commit 34807bfa authored by schmitting's avatar schmitting
Browse files

Some minro modifications concerning the presentation of results

parent 349c569f
Loading
Loading
Loading
Loading
+35 −7
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE campaignloader PUBLIC "-//TESTING TECH//DTD MLF//1.7" "mlf.dtd">
<!-- This file has been automatically generated by TTworkbench Professional 1.1.12.201105181738P, TTthreeCompiler v1.4.19 build 2011.05.17.14.24 on Mon Jun 06 15:27:53 CEST 2011 -->
<!-- This file has been automatically generated by TTworkbench Basic 1.1.12.201105181738P, TTthreeCompiler v1.4.19 build 2011.05.17.14.24 on Tue Jun 07 14:45:44 CEST 2011 -->
<campaignloader>
  <campaign Name="MainModule" Control="true">
    <testadapter Name="com.testingtech.ttcn.tri.PluginTestAdapter" File="" />
    <module Name="TraceParserSystem" File="ttcn/TraceParser/TraceParserSystem.jar" Package="generated_ttcn" />
    <module Name="MainModule" File="ttcn/TraceParser/MainModule.jar" Package="generated_ttcn" />
    <parameter Name="TRACE_PATH" Module="TraceParserSystem">
  <campaign Control="true" Name="MainModule">
    <testadapter File="" Name="com.testingtech.ttcn.tri.PluginTestAdapter">
      <description></description>
    </testadapter>
    <module File="ttcn/TraceParser/TraceParserSystem.jar" Name="TraceParserSystem" Package="generated_ttcn" />
    <module File="ttcn/TraceParser/MainModule.jar" Name="MainModule" Package="generated_ttcn" />
    <parameter Module="TraceParserSystem" Name="PX_TRACE_PATH">
      <description>Path to file that holds the trace</description>
      <type>charstring</type>
      <value><![CDATA[<Values:charstring type="charstring" xmlns:Values="Values.xsd"><Values:value>C:\Demo_Dump2.txt</Values:value></Values:charstring>
      <value><![CDATA[<Values:charstring type="charstring" xmlns:Values="Values.xsd"><Values:value>C:\schmitti\ITS\STF421\ExampleTraces\Demo_DumpPS.txt</Values:value></Values:charstring>
]]></value>
      <default><![CDATA[<Values:charstring type="charstring" xmlns:Values="Values.xsd"><Values:value>C:\Demo_Dump2.txt</Values:value></Values:charstring>
]]></default>
      <presentation>
        <plain />
      </presentation>
    </parameter>
    <parameter Module="TraceParserSystem" Name="PX_MAX_NUM_EMPTY_UPLINK_FRAMES">
      <description>Maximum allowed number of empty uplink frames from the On Board Unit (OBU)</description>
      <type>integer</type>
      <value><![CDATA[<Values:integer type="integer" xmlns:Values="Values.xsd"><Values:value>6</Values:value></Values:integer>
]]></value>
      <default><![CDATA[<Values:integer type="integer" xmlns:Values="Values.xsd"><Values:value>100</Values:value></Values:integer>
]]></default>
      <presentation>
        <plain />
      </presentation>
    </parameter>
    <testcase Module="MainModule" Name="control" Selection="true" Status="stopped" Verdict="none">
      <description>The control part of module MainModule</description>
    </testcase>
    <testcase ActionOnFail="continue" Module="MainModule" Name="TC_Initialization" Retries="0" Runs="1" Selection="false" Status="stopped" Verdict="none">
      <description></description>
    </testcase>
    <testcase ActionOnFail="continue" Module="MainModule" Name="TC_AnalyzesTrace" Retries="0" Runs="1" Selection="false" Status="stopped" Verdict="none">
      <description></description>
    </testcase>
    <testcase ActionOnFail="continue" Module="MainModule" Name="TC_Trace_File_Summary" Retries="0" Runs="1" Selection="false" Status="stopped" Verdict="none">
      <description></description>
    </testcase>
  </campaign>
</campaignloader>
+33 −17
Original line number Diff line number Diff line
@@ -2,17 +2,18 @@ module MainModule {
	import from TraceParserSystem all;

    function f_obuBehaviour() runs on ObuType {
        var address ts := 0;
        var integer startTS := 0;
        var address v_ts := 0;
        var integer v_startTS := 0;
        var template (present) LinkId v_linkId := ?;
        var boolean v_receivedLinkId := false;
        

        transactionOBUTimer.start;
        alt {
            [startTS==0] obuPort.receive(mw_obuBroadCastMsg) -> sender ts { // when the first broadcast message is received then take it's time stamp
            [v_startTS==0] obuPort.receive(mw_obuBroadCastMsg) -> sender v_ts { 
                // when the first broadcast message is received then take it's time stamp
                transactionOBUTimer.stop;
                startTS := ts;
                v_startTS := v_ts;
                transactionOBUTimer.start;
                repeat;
            }
@@ -22,37 +23,38 @@ module MainModule {
                transactionOBUTimer.start;
                repeat;
            }
            [startTS!=0 and v_receivedLinkId == true] obuPort.receive(mw_releaseMsg(v_linkId)) -> sender ts { 
            [v_startTS!=0 and v_receivedLinkId == true] obuPort.receive(mw_releaseMsg(v_linkId)) -> sender v_ts { 
                // when the release message was received take it's time stamp and calculate the transaction time
                // inform the rsu component 
                transactionOBUTimer.stop;
                compPort.send(m_stop);
                if (ts - startTS <= 100000) {
                    setverdict (pass, "Transaction finished in " & int2str(ts - startTS));
                if (v_ts - v_startTS <= 100000) {
                    setverdict (pass, "Transaction finished in " & int2str(v_ts - v_startTS) & "µs");
                }
                else {
                    setverdict (fail, "Transaction finished in more than 100ms (" & int2str(ts - startTS) & ")");
                    setverdict (fail, "Transaction finished in more than 100ms! (" & int2str(v_ts - v_startTS) & "µs)");
                }
                stop;
            }
            [startTS!=0 and v_receivedLinkId == true] obuPort.receive(mw_msg_withLinkId(v_linkId)){
            [v_startTS!=0 and v_receivedLinkId == true] obuPort.receive(mw_msg_withLinkId(v_linkId)){
                transactionOBUTimer.stop;
                transactionOBUTimer.start;
                repeat;
            }
            [startTS!=0 and v_receivedLinkId == true] obuPort.receive(mw_obuBroadCastMsg){ //If another broadcast is received than ignore
            [v_startTS!=0 and v_receivedLinkId == true] obuPort.receive(mw_obuBroadCastMsg){ 
                //If another broadcast is received than ignore
                transactionOBUTimer.stop;
                transactionOBUTimer.start;
                repeat;
            }
            [startTS!=0 and v_receivedLinkId == true] obuPort.receive {
            [v_startTS!=0 and v_receivedLinkId == true] obuPort.receive {
                transactionOBUTimer.stop;
                setverdict(fail, "Unexpected message received");
                compPort.send(m_stop);
				stop;                
            }
            [] transactionOBUTimer.timeout {
                setverdict (inconc, "No message was received");
                setverdict (inconc, "No OBU message was received");
                compPort.send(m_stop);
                stop;
            }
@@ -91,7 +93,13 @@ module MainModule {
                stop;
            }
            []compPort.receive(m_stop) {
                setverdict (pass, "Number of empty messages received: " & int2str(v_cntEmpty));
                if (v_cntEmpty <= PX_MAX_NUM_EMPTY_UPLINK_FRAMES){
                	setverdict (pass, "Number of received empty frames : " & int2str(v_cntEmpty));
                }
                else {
                	setverdict (fail, "Maximum number of received empty frames exceeded! (" 
                					  & int2str(v_cntEmpty) & " > " & int2str(PX_MAX_NUM_EMPTY_UPLINK_FRAMES) & ")");
                }
            }
            []t_rsuTimer.timeout{
                setverdict(inconc, "No RSU messaged received");
@@ -104,7 +112,7 @@ module MainModule {
        
        map(mtc:controlPort, system:controlPort);
        
        controlPort.call(setTraceFile:{TRACE_PATH}, 5.0) {
        controlPort.call(setTraceFile:{PX_TRACE_PATH}, 5.0) {
            [] controlPort.getreply(setTraceFile:{-} value true) {
                setverdict (pass);
            }
@@ -120,7 +128,7 @@ module MainModule {

        controlPort.call(getTransactionCnt:{}, 5.0) {
            [] controlPort.getreply(getTransactionCnt:{} value ?) -> value p_nrOfTransactions {
                setverdict (pass);
                setverdict (pass, "Number of Transaction = " & int2str(p_nrOfTransactions));
            }
            [] controlPort.getreply {
                setverdict (fail, "Unexpected reply");
@@ -146,7 +154,7 @@ module MainModule {
        obuComponent.start(f_obuBehaviour());
        rsuComponent.start(f_rsuBehaviour());
        
        log ("Starting analysis of trace: ", p_traceIndex);
        log ("Starting analysis of trace: " & int2str(p_traceIndex));
        
        controlPort.call(startAnalyzeTrace:{p_traceIndex}, 5.0) {
            [] controlPort.getreply(startAnalyzeTrace:{-} value true) {
@@ -165,13 +173,21 @@ module MainModule {
        all component.done;
    }
    
    testcase TC_Trace_File_Summary(inout integer p_traceIndex) runs on MtcType system SystemType {
        var ObuType obuComponent := ObuType.create("OBU"); //DL
        var RsuType rsuComponent := RsuType.create("RSU"); //UL
               
        log ("Summary analysis of all traces in : " & PX_TRACE_PATH);
        
            
    }
    control {
        var integer v_nrOfTransactions := 0;
        execute(TC_Initialization(v_nrOfTransactions));
        log("Number of traces: " , v_nrOfTransactions);
        for(var integer i:=0; i<v_nrOfTransactions; i:=i + 1) {
            execute(TC_AnalyzesTrace(i));
        }
        execute(TC_Trace_File_Summary(v_nrOfTransactions));
    }
    
}
 No newline at end of file
+4 −2
Original line number Diff line number Diff line
module TraceParserSystem {
    
    modulepar charstring TRACE_PATH:= "C:\Demo_Dump2.txt";
    /* @desc Path to file that holds the trace */
    modulepar charstring PX_TRACE_PATH:= "C:\Demo_Dump2.txt";
    /* @desc Maximum allowed number of empty uplink frames from the On Board Unit (OBU) */
    modulepar integer PX_MAX_NUM_EMPTY_UPLINK_FRAMES:= 100;
    
    type port TraceMsgPortType message{
        in PayloadStructure;