Loading ccsrc/Protocols/Json/json_codec.cc +12 −19 Original line number Original line Diff line number Diff line Loading @@ -35,23 +35,23 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serviceInfo)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serviceInfo)) { const AppEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo(); const AppEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo(); service_info.encode(AppEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); service_info.encode(AppEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"ServiceInfo\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"ServiceInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) { const AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription(); const AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription(); app.encode(AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); app.encode(AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) { const AppEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule(); const AppEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule(); dns_rule.encode(AppEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); dns_rule.encode(AppEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"DnsRule\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"DnsRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serAvailabilityNotificationSubscription)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serAvailabilityNotificationSubscription)) { const AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription& ser = msg.serAvailabilityNotificationSubscription(); const AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription& ser = msg.serAvailabilityNotificationSubscription(); ser.encode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); ser.encode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) { const AppEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); const AppEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); traffic_rule.encode(AppEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); traffic_rule.encode(AppEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + */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"); } } Loading @@ -75,6 +75,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); return -1; // TODO Use p_data instead of return -1 return -1; // TODO Use p_data instead of return -1 } } loggers::get_instance().log("json_codec::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); } } // Remove data structure name (if present) ... // Remove data structure name (if present) ... Loading @@ -89,7 +90,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy // ..and create the decoding buffer // ..and create the decoding buffer TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_EncDec::clear_error(); TTCN_EncDec::clear_error(); loggers::get_instance().log("json_codec::decode: decoding_buffer=%c/%s", str[0], str.c_str()); loggers::get_instance().log("json_codec::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); 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())); if (it->second.find("\"userList\"") != std::string::npos) { // Be careful to the order if (it->second.find("\"userList\"") != std::string::npos) { // Be careful to the order Loading Loading @@ -321,18 +322,10 @@ 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())); bw_info.decode(BwManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); bw_info.decode(BwManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.bwInfo() = bw_info; msg.bwInfo() = bw_info; } else if (it->second.find("\"problemDetails\"") != std::string::npos) { // TODO To be refined, ProblemDetails in different modules } 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); // UEidentityAPI__TypesAndValues::ProblemDetails problem_details; msg.problemDetails() = problem_details; // problem_details.decode(UEidentityAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); // msg.problemDetails__ue__identity() = problem_details; RnisAPI__TypesAndValues::ProblemDetails problem_details; problem_details.decode(RnisAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.problemDetails__rnis() = problem_details; } else { } else { loggers::get_instance().warning("json_codec::decode: Unsupported variant"); loggers::get_instance().warning("json_codec::decode: Unsupported variant"); return -1; return -1; Loading ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn +15 −13 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,8 @@ import from Ams_Pixits all; import from Ams_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading Loading @@ -133,7 +135,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, -, -, Loading Loading @@ -276,7 +278,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 ) ) Loading Loading @@ -925,7 +927,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 ) ) Loading Loading @@ -1073,7 +1075,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 ) ) Loading Loading @@ -1190,7 +1192,7 @@ mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 ) ) Loading Loading @@ -1299,7 +1301,7 @@ mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( ) ) ) ) ) ) Loading Loading @@ -1432,7 +1434,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( ) ) ) ) ) ) Loading Loading @@ -1494,7 +1496,7 @@ mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( ) ) ) ) ) ) Loading ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn +21 −9 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,8 @@ module AtsMec_AppEnablementAPI_TestCases { import from AppEnablementAPI_Pixits all; import from AppEnablementAPI_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading Loading @@ -179,7 +181,17 @@ module AtsMec_AppEnablementAPI_TestCases { m_http_message_body_json( m_http_message_body_json( m_body_json_service_info( m_body_json_service_info( m_service_info( m_service_info( PX_SERVICE_NAME PX_SERVICE_NAME, -, -, -, -, -, m_transport_info( "transportId1", "TC_MEC_SRV_APPSAQ_002_OK", REST_HTTP, "HTTP", "2.0", m_end_point_uris({"/meMp1/service/MyEntryPoint"}), m_security_info ) ) ) ) ) ) ) Loading Loading @@ -218,7 +230,7 @@ module AtsMec_AppEnablementAPI_TestCases { ; ; to the MEC_APP_Subscriber entity to the MEC_APP_Subscriber entity */ */ log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo and set notofocation ***"); log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo and set notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { } else { log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); Loading Loading @@ -2839,7 +2851,7 @@ module AtsMec_AppEnablementAPI_TestCases { // Postamble // Postamble f_cf_01_http_down(); f_cf_01_http_down(); } // End of testcase TC_MEC_SRV_APPSAQ_004_NF } // End of testcase TC_MEC_SRV_TRAF_003_NF /** /** * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition Loading ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn +2 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,8 @@ module AtsMec_RadioNodeLocationAPI_TestCases { import from LocationAPI_Pixits all; import from LocationAPI_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +42 −40 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,8 @@ module AtsMec_RnisAPI_TestCases { import from RnisAPI_Pixits all; import from RnisAPI_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading Loading @@ -234,7 +236,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -308,7 +310,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -596,7 +598,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -654,7 +656,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading @@ -712,7 +714,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -770,7 +772,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading @@ -828,7 +830,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -886,7 +888,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading @@ -944,7 +946,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -1002,7 +1004,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading
ccsrc/Protocols/Json/json_codec.cc +12 −19 Original line number Original line Diff line number Diff line Loading @@ -35,23 +35,23 @@ int json_codec::encode (const LibItsHttp__JsonMessageBodyTypes::JsonBody& msg, O } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serviceInfo)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serviceInfo)) { const AppEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo(); const AppEnablementAPI__TypesAndValues::ServiceInfo& service_info = msg.serviceInfo(); service_info.encode(AppEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); service_info.encode(AppEnablementAPI__TypesAndValues::ServiceInfo_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"ServiceInfo\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"ServiceInfo\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_appTerminationNotificationSubscription)) { const AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription(); const AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription& app = msg.appTerminationNotificationSubscription(); app.encode(AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); app.encode(AppEnablementAPI__TypesAndValues::AppTerminationNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"AppTerminationNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_dnsRule)) { const AppEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule(); const AppEnablementAPI__TypesAndValues::DnsRule& dns_rule = msg.dnsRule(); dns_rule.encode(AppEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); dns_rule.encode(AppEnablementAPI__TypesAndValues::DnsRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"DnsRule\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"DnsRule\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serAvailabilityNotificationSubscription)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_serAvailabilityNotificationSubscription)) { const AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription& ser = msg.serAvailabilityNotificationSubscription(); const AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription& ser = msg.serAvailabilityNotificationSubscription(); ser.encode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); ser.encode(AppEnablementAPI__TypesAndValues::SerAvailabilityNotificationSubscription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/; } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) { } else if (msg.ischosen(LibItsHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) { const AppEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); const AppEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule(); traffic_rule.encode(AppEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); traffic_rule.encode(AppEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON); data = char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}")); data = /*char2oct(CHARSTRING("{\"SerAvailabilityNotificationSubscription\": ")) + */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"); } } Loading @@ -75,6 +75,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); loggers::get_instance().warning("json_codec::decode: Failed to access p_params item (decode_str)"); return -1; // TODO Use p_data instead of return -1 return -1; // TODO Use p_data instead of return -1 } } loggers::get_instance().log("json_codec::decode: it->second='%c' / '%s'", it->second.c_str()[0], it->second.c_str()); } } // Remove data structure name (if present) ... // Remove data structure name (if present) ... Loading @@ -89,7 +90,7 @@ int json_codec::decode (const OCTETSTRING& p_data, LibItsHttp__JsonMessageBodyTy // ..and create the decoding buffer // ..and create the decoding buffer TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_EncDec::set_error_behavior(TTCN_EncDec::ET_ALL, TTCN_EncDec::EB_DEFAULT); TTCN_EncDec::clear_error(); TTCN_EncDec::clear_error(); loggers::get_instance().log("json_codec::decode: decoding_buffer=%c/%s", str[0], str.c_str()); loggers::get_instance().log("json_codec::decode: decoding_buffer='%c' / '%s'", str[0], str.c_str()); 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())); if (it->second.find("\"userList\"") != std::string::npos) { // Be careful to the order if (it->second.find("\"userList\"") != std::string::npos) { // Be careful to the order Loading Loading @@ -321,18 +322,10 @@ 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())); bw_info.decode(BwManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); bw_info.decode(BwManagementAPI__TypesAndValues::BwInfo_descr_, decoding_buffer_, TTCN_EncDec::CT_JSON); msg.bwInfo() = bw_info; msg.bwInfo() = bw_info; } else if (it->second.find("\"problemDetails\"") != std::string::npos) { // TODO To be refined, ProblemDetails in different modules } 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); // UEidentityAPI__TypesAndValues::ProblemDetails problem_details; msg.problemDetails() = problem_details; // problem_details.decode(UEidentityAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); // msg.problemDetails__ue__identity() = problem_details; RnisAPI__TypesAndValues::ProblemDetails problem_details; problem_details.decode(RnisAPI__TypesAndValues::ProblemDetails_descr_, decoding_buffer, TTCN_EncDec::CT_JSON); msg.problemDetails__rnis() = problem_details; } else { } else { loggers::get_instance().warning("json_codec::decode: Unsupported variant"); loggers::get_instance().warning("json_codec::decode: Unsupported variant"); return -1; return -1; Loading
ttcn/AtsMec/AtsMec_Ams_TestCases.ttcn +15 −13 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,8 @@ import from Ams_Pixits all; import from Ams_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading Loading @@ -133,7 +135,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, -, -, Loading Loading @@ -276,7 +278,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 ) ) Loading Loading @@ -925,7 +927,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 ) ) Loading Loading @@ -1073,7 +1075,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 ) ) Loading Loading @@ -1190,7 +1192,7 @@ mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 ) ) Loading Loading @@ -1299,7 +1301,7 @@ mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( ) ) ) ) ) ) Loading Loading @@ -1432,7 +1434,7 @@ mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( ) ) ) ) ) ) Loading Loading @@ -1494,7 +1496,7 @@ mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_ams_problem_details( mw_body_json_problem_details( ) ) ) ) ) ) Loading
ttcn/AtsMec/AtsMec_AppEnablementAPI_TestCases.ttcn +21 −9 Original line number Original line Diff line number Diff line Loading @@ -28,6 +28,8 @@ module AtsMec_AppEnablementAPI_TestCases { import from AppEnablementAPI_Pixits all; import from AppEnablementAPI_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading Loading @@ -179,7 +181,17 @@ module AtsMec_AppEnablementAPI_TestCases { m_http_message_body_json( m_http_message_body_json( m_body_json_service_info( m_body_json_service_info( m_service_info( m_service_info( PX_SERVICE_NAME PX_SERVICE_NAME, -, -, -, -, -, m_transport_info( "transportId1", "TC_MEC_SRV_APPSAQ_002_OK", REST_HTTP, "HTTP", "2.0", m_end_point_uris({"/meMp1/service/MyEntryPoint"}), m_security_info ) ) ) ) ) ) ) Loading Loading @@ -218,7 +230,7 @@ module AtsMec_AppEnablementAPI_TestCases { ; ; to the MEC_APP_Subscriber entity to the MEC_APP_Subscriber entity */ */ log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo and set notofocation ***"); log("*** " & testcasename() & ": PASS: IUT successfully responds with a ServiceInfo and set notification ***"); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } else { } else { log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); log("*** " & testcasename() & ": FAIL: Header 'Location' was not present in the response headers ***"); Loading Loading @@ -2839,7 +2851,7 @@ module AtsMec_AppEnablementAPI_TestCases { // Postamble // Postamble f_cf_01_http_down(); f_cf_01_http_down(); } // End of testcase TC_MEC_SRV_APPSAQ_004_NF } // End of testcase TC_MEC_SRV_TRAF_003_NF /** /** * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition * @desc Check that the IUT responds with an error when a request sent by a MEC Application doesn't comply with a required condition Loading
ttcn/AtsMec/AtsMec_RadioNodeLocationAPI_TestCases.ttcn +2 −0 Original line number Original line Diff line number Diff line Loading @@ -30,6 +30,8 @@ module AtsMec_RadioNodeLocationAPI_TestCases { import from LocationAPI_Pixits all; import from LocationAPI_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading
ttcn/AtsMec/AtsMec_RnisAPI_TestCases.ttcn +42 −40 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,8 @@ module AtsMec_RnisAPI_TestCases { import from RnisAPI_Pixits all; import from RnisAPI_Pixits all; // LibMec // LibMec import from LibMec_TypesAndValues all; import from LibMec_Templates all; import from LibMec_Functions all; import from LibMec_Functions all; import from LibMec_Pics all; import from LibMec_Pics all; import from LibMec_Pixits all; import from LibMec_Pixits all; Loading Loading @@ -234,7 +236,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -308,7 +310,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -596,7 +598,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -654,7 +656,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading @@ -712,7 +714,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -770,7 +772,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading @@ -828,7 +830,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -886,7 +888,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading Loading @@ -944,7 +946,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_400_bad_request( mw_http_response_400_bad_request( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 400 -, -, 400 )))))) { )))))) { Loading Loading @@ -1002,7 +1004,7 @@ module AtsMec_RnisAPI_TestCases { mw_http_response( mw_http_response( mw_http_response_404_not_found( mw_http_response_404_not_found( mw_http_message_body_json( mw_http_message_body_json( mw_body_json_rni_problem_details( mw_body_json_problem_details( mw_problem_details( mw_problem_details( -, -, 404 -, -, 404 )))))) { )))))) { Loading