Commit ebbbb52c authored by garciay's avatar garciay
Browse files

Validate TP LIS 06

parent d2de69c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -18,7 +18,7 @@ int held_codec::encode (const LibItsHttp__XmlMessageBodyTypes::XmlBody& msg, OCT
  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_Buffer encoding_buffer;
  TTCN_Buffer encoding_buffer;
  
  
  CHARSTRING h("<?xml version=\"1.0\" ?>\n");
  CHARSTRING h("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n");
  encoding_buffer.put_s(h.lengthof(), (const unsigned char*)static_cast<const char*>(h));
  encoding_buffer.put_s(h.lengthof(), (const unsigned char*)static_cast<const char*>(h));
  if (msg.ischosen(LibItsHttp__XmlMessageBodyTypes::XmlBody::ALT_locationRequest)) {
  if (msg.ischosen(LibItsHttp__XmlMessageBodyTypes::XmlBody::ALT_locationRequest)) {
    const urn__ietf__params__xml__ns__geopriv__held::LocationRequestType& location_request = msg.locationRequest();
    const urn__ietf__params__xml__ns__geopriv__held::LocationRequestType& location_request = msg.locationRequest();
+7 −5
Original line number Original line Diff line number Diff line
@@ -5,11 +5,12 @@ LibCommon_Time.PX_TAC := 30.0


LibItsHttp_Pics.PICS_HEADER_HOST := "location-information-service.azurewebsites.net"
LibItsHttp_Pics.PICS_HEADER_HOST := "location-information-service.azurewebsites.net"


LibNg112_Pics.PICS_LIS_URI := "/api/held";
LibNg112_Pics.PICS_LIS_URI := "/api/held"
#LibNg112_Pics.PICS_HTTP_GET_REQUEST := false


#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567890</uri>" # Position location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567890</uri>" # Position location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567891</uri>" # Circle location
LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567891</uri>" # Circle location
LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567892</uri>" # Civc location
#LibNg112_Pixits.PX_DEVICE_URI_TEL := "<uri>+331234567892</uri>" # Civic location
LibNg112_Pixits.PX_DEVICE_NUMBER_POINT := { 43.616891, 7.053179 }
LibNg112_Pixits.PX_DEVICE_NUMBER_POINT := { 43.616891, 7.053179 }
LibNg112_Pixits.PX_CIRCLE_POS := { 43.617174, 7.05275 }
LibNg112_Pixits.PX_CIRCLE_POS := { 43.617174, 7.05275 }
LibNg112_Pixits.PX_CIRCLE_RADIUS := 15.000
LibNg112_Pixits.PX_CIRCLE_RADIUS := 15.000
@@ -62,8 +63,9 @@ system.httpPort.params := "HTTP(codecs=lost:lost_codec;held:held_codec)/TCP(debu
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_03
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_03
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_04
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_04
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_05
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_05
AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsNg112_TestCases.TC_LIS_HTTP_POST_BV_06
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_01
#AtsNg112_TestCases.TC_LIS_HTTP_GET_BV_02
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01
#AtsNg112_TestCases.TC_ECRF_HTTP_POST_BV_01


[GROUPS]
[GROUPS]
+114 −15
Original line number Original line Diff line number Diff line
@@ -410,7 +410,7 @@ module AtsNg112_TestCases {
                                                                                                                          ))))) -> value v_response {
                                                                                                                          ))))) -> value v_response {
            tc_ac.stop;
            tc_ac.stop;


            log("*** " & testcasename() & ": PASS: IUT successfully responds with a Point ***");
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a Reference ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          }
          }
          [] tc_ac.timeout {
          [] tc_ac.timeout {
@@ -717,21 +717,18 @@ module AtsNg112_TestCases {
                v_temp := v_tuple.status.elem_list[0];
                v_temp := v_tuple.status.elem_list[0];
                // Extract Geopriv element from Tuple
                // Extract Geopriv element from Tuple
                v_result := decvalue_unichar(v_temp, v_geopriv);
                v_result := decvalue_unichar(v_temp, v_geopriv);
                log("################### v_geopriv: ", v_geopriv);
                if (v_result == 0) {
                if (v_result == 0) {
                  log(match(v_geopriv, mw_geopriv(mw_location_info({ ? })))); // FIXME Required by TITAN to get details in case of mismatch
                  log(match(v_geopriv, mw_geopriv(mw_location_info({ ? })))); // FIXME Required by TITAN to get details in case of mismatch
                  if (match(v_geopriv, mw_geopriv(mw_location_info({ ? })))) {
                  if (match(v_geopriv, mw_geopriv(mw_location_info({ ? })))) {
                    // Extract Civic address element from Tuple
                    // Extract Civic address element from Tuple
                    v_temp := v_geopriv.location_info.elem_list[0];
                    v_temp := v_geopriv.location_info.elem_list[0];
                    log("################### v_temp: ", v_temp);
                    v_result := decvalue_unichar(v_temp, v_civic_address);
                    v_result := decvalue_unichar(v_temp, v_civic_address);
                    log("################### v_civic_address: ", v_civic_address);
                    log(match(v_civic_address, mw_civicAddress(PX_CIVIC_ADDR_COUNTRY, PX_CIVIC_ADDR_A1, -))); // FIXME Required by TITAN to get details in case of mismatch
                    log(match(v_civic_address, mw_civicAddress("AU"))); // FIXME Required by TITAN to get details in case of mismatch
                    if (match(v_civic_address,  mw_civicAddress(PX_CIVIC_ADDR_COUNTRY, PX_CIVIC_ADDR_A1, -))) {
                    if (match(v_civic_address,  mw_civicAddress("AU"))) {
                      log("*** " & testcasename() & ": PASS: IUT successfully responds with a correct CivicAddress ***");
                      log("*** " & testcasename() & ": PASS: IUT successfully responds with a Point ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    } else {
                    } else {
                      log("*** " & testcasename() & ": FAIL: Incorrect CivicAddress position ***");
                      log("*** " & testcasename() & ": FAIL: Incorrect CivicAddress ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    }
                  } else {
                  } else {
@@ -784,7 +781,7 @@ module AtsNg112_TestCases {
    testcase TC_LIS_HTTP_GET_BV_01() runs on HttpComponent system TestAdapter {
    testcase TC_LIS_HTTP_GET_BV_01() runs on HttpComponent system TestAdapter {
        // Local variables
        // Local variables
        var HeaderLines v_headers;
        var HeaderLines v_headers;
        var HttpMessage v_response;
        var HttpMessage v_response, v_response1;
        
        
        // Test control
        // Test control
        if (not(PICS_LIS_IUT) or (not PICS_HTTP_GET_REQUEST) or (not PICS_LOCATION_HELD)) {
        if (not(PICS_LIS_IUT) or (not PICS_HTTP_GET_REQUEST) or (not PICS_LOCATION_HELD)) {
@@ -801,15 +798,66 @@ module AtsNg112_TestCases {
        // Preamble
        // Preamble
        f_init_default_headers_list(v_headers);
        f_init_default_headers_list(v_headers);
        f_remove_headears_list({ c_header_accept }, v_headers);
        f_remove_headears_list({ c_header_accept }, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_post(
                                                         PICS_LIS_URI,
                                                         v_headers,
                                                         m_http_message_body_xml(m_body_xml_location_request(
                                                                                                             m_locationRequest(
                                                                                                                               { encvalue_unichar(valueof(m_device({ PX_DEVICE_URI_TEL }))) },
                                                                                                                               m_locationTypeType(
                                                                                                                                                  m_locationTypeBase_locationUri                                                                                                                              )
                                                                                                                               )
                                                                                                             )
                                                                                 )
                                                         )
                                     )
                      );
        tc_ac.start;
        alt {
          [] httpPort.receive(
                              mw_http_response(
                                               mw_http_response_ok(
                                                                   mw_http_message_body_xml(
                                                                                            mw_body_xml_location_response(
                                                                                                                          mw_locationResponse(
                                                                                                                                              mw_locationUriSet
                                                                                                                                              )
                                                                                                                          ))))) -> value v_response1 {
            tc_ac.stop;
            f_sleep(1.0);
            httpPort.send(
            httpPort.send(
                          m_http_request(
                          m_http_request(
                                         m_http_request_get(
                                         m_http_request_get(
                                                            PICS_LIS_URI,
                                                            PICS_LIS_URI,
                                                        v_headers
                                                            v_headers,
                                                            m_http_message_body_xml(m_body_xml_location_request(
                                                                                                                m_locationRequest(
                                                                                                                                  { encvalue_unichar(valueof(m_device({ "<uri>" & v_response1.response.body.xml_body.locationResponse.locationUriSet.locationURI_list[0] & "</uri>" }))) },
                                                                                                                                  m_locationTypeType(
                                                                                                                                                     m_locationTypeBase_locationUri,
                                                                                                                                                     true
                                                                                                                                                     )
                                                                                                                                  )
                                                                                                                )
                                                                                     )
                                                             )
                                                             )
                                         )
                                         )
                          );
                          );
            log("*** " & testcasename() & ": INFO: IUT successfully responds with a Reference ***");
            f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success);
            f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_success);
          }
          [] httpPort.receive(mw_http_response) {
            tc_ac.stop;
            log("*** " & testcasename() & ": FAIL: Unexpected message received ***");
            f_selfOrClientSyncAndVerdictTestBody(c_prDone, e_error);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        
        // Test body
        // Test body
        tc_ac.start;
        tc_ac.start;
@@ -829,7 +877,7 @@ module AtsNg112_TestCases {
            var integer v_result;
            var integer v_result;
            
            
            tc_ac.stop;
            tc_ac.stop;

            log("##################################### ", v_response);
            // Extract presence element from Location-Response
            // Extract presence element from Location-Response
            v_temp := v_response.response.body.xml_body.locationResponse.elem_list[0];
            v_temp := v_response.response.body.xml_body.locationResponse.elem_list[0];
            v_result := decvalue_unichar(v_temp, v_presence);
            v_result := decvalue_unichar(v_temp, v_presence);
@@ -882,6 +930,57 @@ module AtsNg112_TestCases {
        f_cf_01_http_down();
        f_cf_01_http_down();
    } // End of testcase TC_LIS_HTTP_GET_BV_01
    } // End of testcase TC_LIS_HTTP_GET_BV_01
    
    
    testcase TC_LIS_HTTP_GET_BV_02() runs on HttpComponent system TestAdapter {
        // Local variables
        var HeaderLines v_headers;
        var HttpMessage v_response;
        
        // Test control
        if (not(PICS_LIS_IUT) or (PICS_HTTP_GET_REQUEST) or (not PICS_LOCATION_HELD)) {
            log("*** " & testcasename() & ": PICS_LIS_IUT and not PICS_HTTP_GET_REQUEST and PICS_LOCATION_HELD 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);
        f_remove_headears_list({ c_header_accept }, v_headers);
        httpPort.send(
                      m_http_request(
                                     m_http_request_get(
                                                        PICS_LIS_URI,
                                                        v_headers
                                                        )
                                     )
                      );
        f_selfOrClientSyncAndVerdictTestBody(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 HTTP 404 Not found ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_LIS_HTTP_GET_BV_02
    
  } // End of group lis_role
  } // End of group lis_role
  
  
  group ecrf_role {
  group ecrf_role {
+10 −0
Original line number Original line Diff line number Diff line
@@ -8,6 +8,12 @@ module LibNg112_Pixits {
        extension "File:../xsd/RFC5222_lost.xsd";
        extension "File:../xsd/RFC5222_lost.xsd";
    }
    }


  // RFC 5139
  import from urn_ietf_params_xml_ns_pidf_geopriv10_civicAddr language "XSD" all
    with {
        extension "File:../xsd/RFC5139_pdif_geopriv10_civic_address.xsd";
    }
  
  // OpenGIS
  // OpenGIS
  import from http_www_opengis_net_pidflo_1_0 language "XSD" all
  import from http_www_opengis_net_pidflo_1_0 language "XSD" all
    with {
    with {
@@ -58,6 +64,10 @@ module LibNg112_Pixits {
  
  
  modulepar XSD.AnyURI PX_SRS_NAME := "urn:ogc:def:crs:EPSG::4326";
  modulepar XSD.AnyURI PX_SRS_NAME := "urn:ogc:def:crs:EPSG::4326";
  
  
  modulepar Iso3166a2 PX_CIVIC_ADDR_COUNTRY := "AU";
  
  modulepar XSD.String PX_CIVIC_ADDR_A1 := "NSW";
  
  modulepar XSD.Token PX_LOST_ID := "6020688f1ce1896d";
  modulepar XSD.Token PX_LOST_ID := "6020688f1ce1896d";
  
  
  modulepar XSD.AnyURI PX_LOST_SERVICE_URN_1 := "urn:service:sos.police";
  modulepar XSD.AnyURI PX_LOST_SERVICE_URN_1 := "urn:service:sos.police";
+42 −13
Original line number Original line Diff line number Diff line
@@ -14,19 +14,48 @@ module TestCodec_HttpPort {
  import from XSD all;
  import from XSD all;
  
  
  // RFC5985 Held
  // RFC5985 Held
  import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all;
  import from urn_ietf_params_xml_ns_geopriv_held language "XSD" all
  import from urn_ietf_params_xml_ns_geopriv_held_id language "XSD" all;
    with {
  import from urn_ietf_params_xml_ns_pidf_geopriv10 language "XSD" all;
        extension "File:../xsd/RFC5985_held.xsd";
  import from urn_ietf_params_xml_ns_pidf_geopriv10_basicPolicy language "XSD" all;
    }
  
  // RFC6155 Held ID
  import from urn_ietf_params_xml_ns_pidf_geopriv10_civicLoc language "XSD" all;
  import from urn_ietf_params_xml_ns_geopriv_held_id language "XSD" all
    with {
        extension "File:../xsd/RFC6155_held_id.xsd";
    }
  import from urn_ietf_params_xml_ns_pidf_geopriv10 language "XSD" all
    with {
        extension "File:../xsd/RFC4119_geopriv10.xsd";
    }
  import from urn_ietf_params_xml_ns_pidf_geopriv10_basicPolicy language "XSD" all
    with {
        extension "File:../xsd/RFC4119_geopriv10_basic_policy.xsd";
    }
  import from urn_ietf_params_xml_ns_pidf_geopriv10_civicAddr language "XSD" all
    with {
        extension "File:../xsd/RFC5139_pdif_geopriv10_civic_address.xsd";
    }


  // 
  // RFC3863
  import from urn_ietf_params_xml_ns_pidf language "XSD" all;
  import from urn_ietf_params_xml_ns_pidf language "XSD" all
    with {
        extension "File:../xsd/RFC3863_pidf.xsd";
    }
    
    
  // OpenGIS
  // OpenGIS
  import from urn_ietf_params_xml_ns_pidf_geopriv10_geoShape language "XSD" all;
  import from http_www_opengis_net_pidflo_1_0 language "XSD" all
  import from http_www_opengis_net_gml language "XSD" all;
    with {
        extension "File:../xsd/GLM_pidf_lo_shape.xsd";
    }
  import from http_www_opengis_net_gml language "XSD" all
    with {
        extension "File:../xsd/gmlBase.xsd";
        extension "File:../xsd/basicTypes.xsd";
        extension "File:../xsd/measures.xsd";
        extension "File:../xsd/geometryPrimitives.xsd";
        extension "File:../xsd/geometryBasic0d1d.xsd";
        extension "File:../xsd/geometryBasic2d.xsd";
    }
  
  
  // LibCommon
  // LibCommon
  
  
Loading