module test_LibItsBtp_TypesAndValues /*language "TTCN-3:2009 Advanced Parameterization"*/ { import from test_CommonCodec all; import from LibItsBtp_TestSystem all; import from LibItsBtp_Templates all; import from LibItsBtp_TypesAndValues all; group LibItsBtp_DummyTemplates { template (value) UtEvent m_utEventBtpA := { utBtpEvent := { btpA := { destinationPort := 1234, sourcePort := 5678 } } } template (value) UtEvent m_utEventBtpB := { utBtpEvent := { btpB := { destinationPort := 123, destinationPortInfo := 432 } } } template (value) UtEvent m_utEventBtpPayload := { utBtpEvent := { payload := { decodedPayload := omit, rawPayload := 'f005ba11'O } // End of 'payload' field } } template BtpInd m_btpInd(template (present) BtpPacket p_btpPkt) := { msgIn := p_btpPkt } template (value) BtpPacket m_btpA_Without_Payload ( template (value) BtpPortId p_destPort, template (value) BtpPortId p_sourcePort ):= { header := { btpAHeader := { destinationPort := p_destPort, sourcePort := p_sourcePort } }, payload := omit } template BtpPacket m_btpA_With_Payload ( in template (value) BtpPortId p_destPort, in template (value) BtpPortId p_sourcePort, in template DecodedBtpPayload p_decodedPayload, in template (value) octetstring p_rawPayload ) := { header := { btpAHeader := { destinationPort := p_destPort, sourcePort := p_sourcePort } }, payload := { decodedPayload := p_decodedPayload, rawPayload := p_rawPayload } } template (value) BtpPacket m_btpB_Without_Payload ( template (value) BtpPortId p_destPort, template (value) BtpPortId p_destinationPortInfo ):= { header := { btpBHeader := { destinationPort := p_destPort, destinationPortInfo := p_destinationPortInfo } }, payload := omit } template BtpPacket mw_btpA_With_Payload ( in template (present) BtpPortId p_destPort, in template (present) BtpPortId p_sourcePort, in template DecodedBtpPayload p_decodedPayload, in template (present) octetstring p_rawPayload ) := { header := { btpAHeader := { destinationPort := p_destPort, sourcePort := p_sourcePort } }, payload := { decodedPayload := p_decodedPayload, rawPayload := p_rawPayload } } template BtpPacket mw_btpA_With_CamPayload ( template (present) BtpPortId p_destPort, template (present) BtpPortId p_sourcePort ):= { header := { btpAHeader := { destinationPort := p_destPort, sourcePort := p_sourcePort } }, payload := { decodedPayload := { camPacket := { header := { protocolVersion := 0, messageID := 0, generationTime := 1319182818078 }, cam := { stationID := 2339, stationCharacteristics := { mobileItsStation := true, privateItsStation := false, physicalRelevantItsStation := true }, referencePosition := { longitude := { hemisphere := east, degree := 0 }, latitude := { hemisphere := north, degree := 0 }, elevation := 0, heading := 0, streetName := omit, positionConfidence := 0, elevationConfidence := 0, roadSegmentID := omit }, camParameters := { vehicleCommonParameters := { vehicleType := 1, stationLength := 0, stationLengthConfidence := omit, stationWidth := 0, stationWidthConfidence := omit, vehicleSpeed := 0, vehicleSpeedConfidence := 0, longAcceleration := 0, longAccelerationConfidence := 0, accelerationControl := ''B, yawRate := { yawDirection := right, yawRateValue := 0 }, yawRateConfidence := 0, exteriorLights := ''B, turnAdvice := omit, distanceToStopLine := omit, occupancy := omit, doorOpen := ''B, posConfidenceEllipse := { semiMajorConfidence := 0, semiMinorConfidence := 0, semiMajorOrientation := 0 }, curvature := 0, curvatureChange := 0, curvatureConfidence := 15, crashStatus := omit, headingConfidence := 0, dangerousGoods := omit }, profileDependent := { basicVehicle := { } } } } // End of 'cam' field } // End of 'camPacket' field }, // End of 'decodedPayload' field rawPayload := ? } // End of 'payload' field } // End of template mw_btpA_With_CamPayload template BtpPacket mw_btpA_With_DenmPayload ( template (present) BtpPortId p_destPort, template (present) BtpPortId p_sourcePort ):= { header := { btpAHeader := { destinationPort := p_destPort, sourcePort := p_sourcePort } }, payload := { decodedPayload := { denmPacket := { header := { protocolVersion := 0, messageID := 1, generationTime := 1319187879132 }, denm := { management := { actionID := { stationID := 2339, sequenceNo := 29 }, dataVersion := 0, expiryTime := 1319187938835, frequency := omit, reliability := 0, isNegation := false }, situation := { trafficFlowEffect := omit, situation := { cause := 103, subCause := 0 }, linkedCause := omit, severity := informative, eventCharact := omit, vehicleCommonParameters := omit, profile := omit }, location := { eventPosition := { eventPositionCurrentDefinition := { refPosition := { longitude := { hemisphere := east, degree := 0 }, latitude := { hemisphere := north, degree := 0 }, elevation := 0, heading := 0, streetName := omit, positionConfidence := 0, elevationConfidence := 0, roadSegmentID := omit }, eventSpeed := 0 } }, locationRef := { trace := { traceID := 0, waypoints := { { ptLat := { hemisphere := south, degree := 0 }, ptLong := { hemisphere := west, degree := 0 }, ptAlt := 0 } } } }, relevanceArea := { geoAreaCenterLatitude := { hemisphere := south, degree := 0 }, geoAreaCenterLongitude := { hemisphere := west, degree := 0 }, shape := {circle := { radius := 0 } }, directionalityFilter := noFilter, disseminationAreaSize := omit } } } // End of 'denm' field } // End of 'denmPacket' field }, // End of 'decodedPayload' field rawPayload := ? } // End of 'payload' field } // End of template mw_btpA_With_DenmPayload template BtpPacket mw_btpA_Without_Payload ( template (present) BtpPortId p_destPort, template (present) BtpPortId p_sourcePort ):= { header := { btpAHeader := { destinationPort := p_destPort, sourcePort := p_sourcePort } }, payload := omit } } // End of group LibItsBtp_DummyTemplates group testAcPrimitives { } // End of group testAcPrimitives group testBtpPrimitiveMessages { /** * @desc validate BtpReq/BTP type A * @verdict Pass on success, Fail otherwise */ testcase tc_BtpReq_A() runs on TCType system TCType { test_PDU( m_btpReq( m_btpA_Without_Payload (1234, 5678)), true, oct2bit('4b000a34000732000404d2162e'O)); } /** * @desc validate BtpReq/BTP type A with payload * @verdict Pass on success, Fail otherwise */ testcase tc_BtpReq_A_With_Payload() runs on TCType system TCType { test_PDU( m_btpReq( m_btpAWithPorts ( 1234, 5678, { decodedPayload := omit, rawPayload := 'ca5caded'O } // End of 'payload' field )), true, oct2bit('4b000e34000b32000404d2162eca5caded'O)); } /** * @desc validate BtpReq/BTP type A with payload * @verdict Pass on success, Fail otherwise */ testcase tc_BtpReq_A_With_DenmPayload() runs on TCType system TCType { test_PDU( m_btpReq( m_btpAWithPorts ( 1234, 5678, { decodedPayload := { denmPacket := { header := { protocolVersion := 0, messageID := 1, generationTime := 1319187879132 }, denm := { management := { actionID := { stationID := 2339, sequenceNo := 29 }, dataVersion := 0, expiryTime := 1319187938835, frequency := omit, reliability := 0, isNegation := false }, situation := { trafficFlowEffect := omit, situation := { cause := 103, subCause := 0 }, linkedCause := omit, severity := informative, eventCharact := omit, vehicleCommonParameters := omit, profile := omit }, location := { eventPosition := { eventPositionCurrentDefinition := { refPosition := { longitude := { hemisphere := east, degree := 0 }, latitude := { hemisphere := north, degree := 0 }, elevation := 0, heading := 0, streetName := omit, positionConfidence := 0, elevationConfidence := 0, roadSegmentID := omit }, eventSpeed := 0 } }, locationRef := { trace := { traceID := 0, waypoints := { { ptLat := { hemisphere := south, degree := 0 }, ptLong := { hemisphere := west, degree := 0 }, ptAlt := 0 } } } }, relevanceArea := { geoAreaCenterLatitude := { hemisphere := south, degree := 0 }, geoAreaCenterLongitude := { hemisphere := west, degree := 0 }, shape := {circle := { radius := 0 } }, directionalityFilter := noFilter, disseminationAreaSize := omit } } } // End of 'denm' field } // End of 'denmPacket' field }, // End of 'decodedPayload' field rawPayload := '0001013325b994dc400001246003a0002664b74fc2600067002d80000000000000000013880000007ffd00a0000000400000000013880085a80000001000000000000000'O } // End of 'payload' field )), true, oct2bit('4b004e34004b32000404d2162e0001013325b994dc400001246003a0002664b74fc2600067002d80000000000000000013880000007ffd00a0000000400000000013880085a80000001000000000000000'O)); } /** * @desc validate BtpReq/BTP type B * @verdict Pass on success, Fail otherwise */ testcase tc_BtpReq_B() runs on TCType system TCType { test_PDU( m_btpReq( m_btpB_Without_Payload (4321, 8765)), true, oct2bit('4b000a34000733000410e1223d'O)); } /** * @desc validate BtpReq/BTP type B with payload * @verdict Pass on success, Fail otherwise */ testcase tc_BtpReq_B_With_Payload() runs on TCType system TCType { test_PDU( m_btpReq( m_btpBWithPorts ( 4321, 8765, { decodedPayload := omit, rawPayload := 'f1a7f007ed'O } // End of 'payload' field )), true, oct2bit('4b000f34000c33000410e1223df1a7f007ed'O)); } /** * @desc validate BtpInd/BTP type A * @verdict Pass on success, Fail otherwise */ testcase tc_BtpInd_A() runs on TCType system TCType { test_PDU( m_btpInd( m_btpA_Without_Payload (4321, 8765)), true, oct2bit('4a000a34000732000410e1223d'O)); } /** * @desc validate BtpInd/BTP type A with payload * @verdict Pass on success, Fail otherwise */ testcase tc_BtpInd_A_With_Payload() runs on TCType system TCType { test_PDU( m_btpInd( m_btpAWithPorts ( 4321, 8765, { decodedPayload := omit, rawPayload := 'f1a7f007ed'O } // End of 'payload' field )), true, oct2bit('4a000f34000c32000410e1223df1a7f007ed'O)); } testcase tc_BtpInd_A_With_CamPayload() runs on TCType system TCType { test_decodePDU( { msgIn := mw_btpA_With_CamPayload(4321, 8765) }, '4a003d34000c32000410e1223d00000133256c5b1e40000248d6c0000000000000000009c40000002060080000003ffe83e80004000000000000007ffd7ffe00'O ); } testcase tc_BtpInd_A_With_TrunkatedCamPayload() runs on TCType system TCType { test_decodePDU( { msgIn := mw_btpA_With_CamPayload(4321, 8765) }, '4a003834000c32000410e1223d00000133256c5b1e40000248d6c0000000000000000009c4080000003ffe83e80004000000000000007ffd7ffe00'O ); if (getverdict() == fail) { setverdict(pass); } else { setverdict(fail); } } testcase tc_BtpInd_A_With_DenmPayload() runs on TCType system TCType { test_decodePDU( { msgIn := mw_btpA_With_DenmPayload(4321, 8765) }, '4a004e34000c32000410e1223d0001013325b994dc400001246003a0002664b74fc2600067002d80000000000000000013880000007ffd00a0000000400000000013880085a80000001000000000000000ff00080000013325b9950b'O ); } /** * @desc validate BtpInd/BTP type B * @verdict Pass on success, Fail otherwise */ testcase tc_BtpInd_B() runs on TCType system TCType { test_PDU( m_btpInd( m_btpB_Without_Payload (4321, 8765)), true, oct2bit('4a000a34000733000410e1223d'O)); } /** * @desc validate BtpInd/BTP type B with payload * @verdict Pass on success, Fail otherwise */ testcase tc_BtpInd_B_With_Payload() runs on TCType system TCType { test_PDU( m_btpInd( m_btpBWithPorts ( 4321, 8765, { decodedPayload := omit, rawPayload := 'de1ec7ab1e'O } // End of 'payload' field )), true, oct2bit('4a000f34000c33000410e1223dde1ec7ab1e'O)); } } // End of group testBtpPrimitiveMessages // testcase tc_BTP_A() runs on TCType system TCType { // test_PDU(m_btpA (65535, 65535, '0102030405'O), true, oct2bit('FFFFFFFF0102030405'O)); // } // // testcase tc_BTP_B() runs on TCType system TCType { // test_PDU(m_btpB (65535, 65535, '0102030405'O), true, oct2bit('FFFFFFFF0102030405'O)); // } group testUtEvent { testcase tc_UtBtpInitialize() runs on TCType system TCType { test_PDU(m_btpInitialize, false); } testcase tc_UtEvent_A() runs on TCType system TCType { test_PDU(m_utEventBtpA, false); } testcase tc_UtEvent_B() runs on TCType system TCType { test_PDU(m_utEventBtpB, false); } testcase tc_UtEvent_Payload() runs on TCType system TCType { test_PDU(m_utEventBtpPayload, false); } } // End of group testUtEvent } // End of module test_LibItsBtp_TypesAndValues