Loading ccsrc/Protocols/Json/json_codec.cc +9 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_predictedQos)) { const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos(); predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { loggers::get_instance().error("json_codec::encode: Not supported"); } Loading Loading @@ -424,6 +428,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); pc5_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::Pc5ProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.pc5ProvisioningInfo() = pc5_provisioning_info; } else if ((it->second.find("\"predictedQos\"") != std::string::npos) || (it->second.find("\"locationGranularity\"") != std::string::npos)) { V2XInformationServiceAPI__TypesAndValues::PredictedQos predicted_qos; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); predicted_qos.decode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.predictedQos() = predicted_qos; } else if (it->second.find("\"detail\"") != std::string::npos) { LibMec__TypesAndValues::ProblemDetails problem_details; problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); Loading etc/AtsMec/AtsMec_Mockoon.cf_ +7 −3 Original line number Diff line number Diff line Loading @@ -301,15 +301,19 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_NF # Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01 #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01 # Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_BR # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_NF # Check that the IUT sends a request about QoS information for a vehicular UE when queried by a MEC Application AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_BR # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_NF [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the Loading ttcn/AtsMec/AtsMec_DeviceApplicationInterface_TestCases.ttcn 0 → 100644 +3 −0 Original line number Diff line number Diff line module AtsMec_DeviceApplicationInterface_TestCases { } // End of module AtsMec_DeviceApplicationInterface_TestCases Loading
ccsrc/Protocols/Json/json_codec.cc +9 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,10 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo(); mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_predictedQos)) { const V2XInformationServiceAPI__TypesAndValues::PredictedQos& predicted_qos = msg.predictedQos(); predicted_qos.encode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = /*char2oct(CHARSTRING("{\"TrafficRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else { loggers::get_instance().error("json_codec::encode: Not supported"); } Loading Loading @@ -424,6 +428,11 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); pc5_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::Pc5ProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.pc5ProvisioningInfo() = pc5_provisioning_info; } else if ((it->second.find("\"predictedQos\"") != std::string::npos) || (it->second.find("\"locationGranularity\"") != std::string::npos)) { V2XInformationServiceAPI__TypesAndValues::PredictedQos predicted_qos; TTCN_Buffer decoding_buffer_(OCTETSTRING(str.length(), (const unsigned char*)str.c_str())); predicted_qos.decode(V2XInformationServiceAPI__TypesAndValues::PredictedQos_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.predictedQos() = predicted_qos; } else if (it->second.find("\"detail\"") != std::string::npos) { LibMec__TypesAndValues::ProblemDetails problem_details; problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); Loading
etc/AtsMec/AtsMec_Mockoon.cf_ +7 −3 Original line number Diff line number Diff line Loading @@ -301,15 +301,19 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_002_NF # Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01 #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_01 # Check that the IUT responds with a configured provisioning information over PC5 when queried by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_OK_02 # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_BR # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_003_NF # Check that the IUT sends a request about QoS information for a vehicular UE when queried by a MEC Application AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_OK # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_BR # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application #AtsMec_V2XInformationServiceAPI_TestCases.TC_MEC_MEC030_SRV_V2X_004_NF [GROUPS] # In this section you can specify groups of hosts. These groups can be used inside the Loading
ttcn/AtsMec/AtsMec_DeviceApplicationInterface_TestCases.ttcn 0 → 100644 +3 −0 Original line number Diff line number Diff line module AtsMec_DeviceApplicationInterface_TestCases { } // End of module AtsMec_DeviceApplicationInterface_TestCases