AtsMec_DeviceApplicationInterfaceAPI_TestCases.ttcn 60.7 KB
Newer Older
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_BR

    /**
     * @desc Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application
     * @see https://forge.etsi.org/rep/mec/gs016-dev-app-api/blob/master/UEAppInterfaceApi.json
     * @see https://forge.etsi.org/rep/mec/gs032p2-test-purposes/blob/v2.2.1-dev/Test%20Purposes/MEC016/MEO/UEAPPS/SysUeApplicationsLocation.tplan2
     */
    testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_NF() runs on HttpComponent system HttpTestAdapter {
        // Local variables
        var Headers v_headers;
        
        // Test control
        if (not(PICS_MEC_PLAT) or not(PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED)) {
            log("*** " & testcasename() & ": PICS_MEC_PLAT and PICS_DEVICE_APPLICATION_INTERFACE_API_SUPPORTED required for executing the TC ***");
            setverdict(inconc);
            stop;
        }
        
        // Test component configuration
        f_cf_01_http_up();
        
        // Test adapter configuration
        
        // Preamble
        f_init_default_headers_list(-, -, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         PICS_ROOT_API & PX_DEVICE_APP_LIST_URI,
                                                         v_headers,
                                                         m_http_message_body_json(
                                                                                  m_body_json_device_info_app_location_availability(
                                                                                                                                    m_application_location_availability(
                                                                                                                                                                        PX_ASSOCIATE_DEV_APPID,
                                                                                                                                                                        m_application_location_availability_info(
                                                                                                                                                                                                                 PX_APPD_ID,
                                                                                                                                                                                                                 PX_APP_NAME,
                                                                                                                                                                                                                 PX_APP_PROVIDER,
                                                                                                                                                                                                                 PX_APPD_VERSION
                                                                                                                                                                                                                 )
                                                                                                                                                                        )
                                                                                                                                    )
                                                                                  )
                                                         )
                                     )
                      );
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);

        // Test Body
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_404_not_found
                                               )) {
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of Application ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_MEC_MEC016_MEO_UEAPPLOC_001_NF

  } // End of group me_app_role

} // End of module AtsMec_DeviceApplicationInterfaceAPI_TestCases