Skip to content
ItsRSUsSimulator_TestCases.ttcn 4.44 KiB
Newer Older
garciay's avatar
garciay committed
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;
garciay's avatar
garciay committed
    import from ItsRSUsSimulator_Pics all;
garciay's avatar
garciay committed
    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
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].cam)) {
            tc_cam.start;
        }
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].denms)) {
            tc_denm.start;
        }
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].mapem)) {
garciay's avatar
garciay committed
            tc_mapem.start;
        }
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems)) {
garciay's avatar
garciay committed
            tc_spatem.start;
        }
        if (ispresent(vc_rsuMessagesValueList[PX_RSU_ID - 1].ivim)) {
garciay's avatar
garciay committed
            tc_ivim.start;
        }
garciay's avatar
garciay committed
        alt {
            [] geoNetworkingPort.receive(
                mw_geoNwInd(
                    mw_geoNwPdu(
                        // FIXM Geobroadcast or TSB? mw_geoNwBroadcastPacketWithNextHeader_srem
                        mw_geoNwTsbPacketWithNextHeader_srem(
garciay's avatar
garciay committed
                            ?,
                            ?,
                            e_btpB
            )))) -> value v_gnInd { // Receive a SREM message
                log("*** " & testcasename() & ": DEBUG: Processing SREM ***");
garciay's avatar
garciay committed
                f_processSrem(v_gnInd.msgIn);
                repeat;
            }
            [] geoNetworkingPort.receive(mw_geoNwInd(?)) -> value v_gnInd { // Receive a message
                log("*** " & testcasename() & ": DEBUG: Recieving unsollicited message ***");
garciay's avatar
garciay committed
                // Nothing to do, just for logging purposes
                repeat;
            }
garciay's avatar
garciay committed
            [PICS_GENERATE_CAM] tc_cam.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing CAM ***");
garciay's avatar
garciay committed
                f_prepare_cam(v_payload);
                f_send(v_payload);
                tc_cam.start;
                repeat;
            }
garciay's avatar
garciay committed
            [PICS_GENERATE_DENM] tc_denm.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing DENM ***");
garciay's avatar
garciay committed
                f_prepare_denm(v_payload);
                f_send(v_payload);
                tc_denm.start;
garciay's avatar
garciay committed
                repeat;
            }
garciay's avatar
garciay committed
            [PICS_GENERATE_MAPEM] tc_mapem.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing MAPEM ***");
                f_prepare_mapem(v_payload);
                f_send(v_payload);
                tc_mapem.start;
                repeat;
            }
            [PICS_GENERATE_SPATEM] tc_spatem.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing SPATEM ***");
                for (var integer v_counter := 0; v_counter < lengthof(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems); v_counter := v_counter + 1) {
                    f_prepare_spatem(vc_rsuMessagesValueList[PX_RSU_ID - 1].spatems[v_counter], v_payload);
                    f_send(v_payload);
                }
garciay's avatar
garciay committed
                tc_spatem.start;
                repeat;
            }
            [PICS_GENERATE_IVIM] tc_ivim.timeout {
                log("*** " & testcasename() & ": DEBUG: Processing IVIM ***");
                f_prepare_ivim(v_payload);
                f_send(v_payload);
                tc_ivim.start;
                repeat;
            }
garciay's avatar
garciay committed
        } // End of 'alt' statement
        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
        
        // Postamble
        f_cf01Down();
        
    }
    
} // End of module ItsRSUsSimulator_TestCases