Commit a12da094 authored by YannGarcia's avatar YannGarcia
Browse files

Add TTCN-3 typing for MEC016

parent a5fda293
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -72,6 +72,10 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O
    const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo();
    const TrafficManagementAPI__TypesAndValues::MtsSessionInfo& mts_session_info = msg.mtsSessionInfo();
    mts_session_info.encode(TrafficManagementAPI__TypesAndValues::MtsSessionInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    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("}"))*/;
    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 {
  } else {
    loggers::get_instance().error("json_codec::encode: Not supported");
    loggers::get_instance().error("json_codec::encode: Not supported");
  }
  }
@@ -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()));
    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);
    pc5_provisioning_info.decode(V2XInformationServiceAPI__TypesAndValues::Pc5ProvisioningInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON);
    msg.pc5ProvisioningInfo() = pc5_provisioning_info;
    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) {
  } else if (it->second.find("\"detail\"") != std::string::npos) {
    LibMec__TypesAndValues::ProblemDetails problem_details;
    LibMec__TypesAndValues::ProblemDetails problem_details;
    problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    problem_details.decode(LibMec__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
+7 −3
Original line number Original line Diff line number Diff line
@@ -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
# 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
#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
# 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
# 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
#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
# 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
#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
# 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
#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]
[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
# In this section you can specify groups of hosts. These groups can be used inside the
+3 −0
Original line number Original line Diff line number Diff line
module AtsMec_DeviceApplicationInterface_TestCases {

} // End of module AtsMec_DeviceApplicationInterface_TestCases
Loading