ItsRSUsSimulator_TestCases.ttcn 3.52 KB
Newer Older
garciay's avatar
garciay committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module ItsRSUsSimulator_TestCases {
    
    // Libcommon
    import from LibCommon_VerdictControl all;
    import from LibCommon_Sync all;
    
    // LibItsCommon
    import from LibItsCommon_Functions all;
    
    // LibItsGeoNetworking
    import from LibItsGeoNetworking_TestSystem all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsGeoNetworking_Templates all;
    
    // LibItsDenm
    import from LibItsDenm_Templates all;
    
    // AtsRSUsSimulator
    import from ItsRSUsSimulator_TypesAndValues all;
    import from ItsRSUsSimulator_Templates all;
    import from ItsRSUsSimulator_TestSystem all;
    import from ItsRSUsSimulator_Functions all;
    import from ItsRSUsSimulator_Pixits all;
    
    testcase TC_RSUSIMU_BV_01() runs on ItsRSUsSimulator system ItsGeoNetworkingSystem {
        // Local variables
        var template (value) Payload v_payload;
        var GeoNetworkingInd v_gnInd;
        
        // Test control
        
        // Test component configuration
        f_cf01Up();
            
        // Test adapter configuration
        
        // Preamble
        f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
        
        // Test Body
garciay's avatar
garciay committed
41
42
43
44
45
46
        if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) {
            tc_cam.start;
        }
        if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].denm)) {
            tc_denm.start;
        }
garciay's avatar
garciay committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
        if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) {
            tc_mapem.start;
        }
        if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatem)) {
            tc_spatem.start;
        }
        if (isbound(vc_rsuMessagesValueList[PX_RSU_ID - 1].ivim)) {
            tc_ivim.start;
        }
        alt {
            [] geoNetworkingPort.receive(
                mw_geoNwInd(
                    mw_geoNwPdu(
                        mw_geoNwUnicastPacketWithNextHeader_srem(
                            ?,
                            ?,
                            e_btpB
            )))) -> value v_gnInd { // Receive a SREM message
                f_processSrem(v_gnInd.msgIn);
                repeat;
            }
            [] geoNetworkingPort.receive(mw_geoNwInd(?)) -> value v_gnInd { // Receive a message
                // Nothing to do, just for logging purposes
                repeat;
            }
            [] tc_cam.timeout {
                f_prepare_cam(v_payload);
                f_send(v_payload);
                tc_cam.start;
                repeat;
            }
            [] tc_denm.timeout {
                f_prepare_denm(v_payload);
                f_send(v_payload);
                tc_cam.start;
                repeat;
            }
//                [] tc_spatem.timeout {
//                    f_prepare_spatem(v_payload);
//                    f_send(v_payload);
//                    tc_spatem.start;
//                    repeat;
//                }
//                [] tc_mapem.timeout {
//                    f_prepare_spatem(v_payload);
//                    f_send(v_payload);
//                    tc_mapem.start;
//                    repeat;
//                }
//                [] tc_ivim.timeout {
//                    f_prepare_ivim(v_payload);
//                    f_send(v_payload);
//                    tc_ivim.start;
//                    repeat;
//                }
        } // End of 'alt' statement
        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
        
        // Postamble
        f_cf01Down();
        
    }
    
} // End of module ItsRSUsSimulator_TestCases