Commit c6b3dc8e authored by Michael Proestler's avatar Michael Proestler
Browse files

Add TC_ECRF_LOST_BV_10

Change ServceList to Set (order is not standardized)
parent 3bdb6b6a
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -91,6 +91,30 @@ module AtsECRF_Functions {
                      );
  }    

  function f_sendListServicesByLocationRequest(template (value) ListServicesByLocation p_request) runs on HttpComponent {
    var boolean c_debug := true;

	  // Local variables
    var Headers v_headers;
    
    f_init_default_headers_list(-, -, v_headers);
    f_remove_headers_list({ c_header_accept, c_header_authorization }, v_headers);

    if (c_debug) {
      f_set_headers_list({ "X-TestcaseName"},{ testcasename()},v_headers);
    }
      
	  httpPort.send(
      	             m_http_request(
                                     m_http_request_post(
                                                         PICS_ECRF_URI,
                                                         v_headers,
                                                         m_http_message_body_xml(m_body_xml_list_services_by_location_request(p_request))
                                                         )
                                     )
                      );
  }    


	function f_receiveResponse(template HttpMessage p_message) runs on HttpComponent return HttpMessage {
	  var HttpMessage v_response;
+5 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ module AtsECRF_Pics {
   */
  modulepar boolean PICS_ECRF_LIST_SERVICES := true;

  /**
   * @desc Does the IUT support ListServicesByLocation ?
   */
  modulepar boolean PICS_ECRF_LIST_SERVICES_BY_LOCATION := true;


  /**
   * @desc HTTP POST Uris
+2 −2
Original line number Diff line number Diff line
@@ -23,14 +23,14 @@ module AtsECRF_Pixits {
        extension "File:../xsd/geometryBasic2d.xsd";
    }
  
  type record of XSD.String StringList;
  type set of XSD.String StringSet;

  modulepar XSD.AnyURI PX_E_UNKNOWN_SERVICE_URN := "urn:service:sos.unknown";
  
  // ECRF Configurations
  modulepar XSD.String PX_ECRF_SOURCE := "ecrf1.gridgears.plugtests.net";
  modulepar XSD.String PX_ECRF_VIA := "ecrf1.gridgears.plugtests.net"; // Should usually be the same as PX_ECRF_SOURCE
  modulepar StringList PX_CONFIGURED_SERVICES := { "urn:service:sos", "urn:service:sos.ambulance", "urn:service:sos.fire", "urn:service:sos.police" };
  modulepar StringSet PX_CONFIGURED_SERVICES := { "urn:service:sos", "urn:service:sos.ambulance", "urn:service:sos.fire", "urn:service:sos.police" };


  // Polygon (Lat/Lon)
+4 −0
Original line number Diff line number Diff line
@@ -22,4 +22,8 @@ module AtsECRF_Templates {
		in template (present) ListServicesResponse p_list_services_response
	) := mw_http_response(mw_http_response_ok(mw_http_message_body_xml(mw_body_xml_list_services_response(p_list_services_response))))

	template HttpMessage mw_http_list_services_by_location_response(
		in template (present) ListServicesByLocationResponse p_list_services_by_location_response
	) := mw_http_response(mw_http_response_ok(mw_http_message_body_xml(mw_body_xml_list_services_by_location_response(p_list_services_by_location_response))))

}
+49 −3
Original line number Diff line number Diff line
@@ -571,8 +571,6 @@ module AtsECRF_TestCases {
      // Test component configuration
      f_cf_01_http_up();
                
      // Test adapter configuration
      
      // Preamble
      f_sendListServicesRequest(m_list_services(-,"urn:service:sos"))            
      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
@@ -591,6 +589,54 @@ module AtsECRF_TestCases {
      f_cf_01_http_down();
    } // End of testcase TC_ECRF_HTTP_POST_BV_09

/**
     * @desc "IUT successfully responds with configured service types for a ListServicesByLocation request"
     */
    testcase TC_ECRF_LOST_BV_10() runs on HttpComponent system TestAdapter {
      // Test control
      f_check_statements({
        { name := "PICS_ECRF_LIST_SERVICES_BY_LOCATION", val := PICS_ECRF_LIST_SERVICES_BY_LOCATION }        
      })
        
        // Test component configuration
        f_cf_01_http_up();
        
        
      // Preamble
      f_sendListServicesByLocationRequest(
                                            m_list_services_by_location(
                                                                          {
                                                                            m_location(
                                                                                        PX_LOCATION_ID,
                                                                                        { m_extension_point(encvalue_unichar(valueof(m_point(PX_POINT_IN_E_POLICE_SERVICE_BOUNDARY, PX_SRS_NAME, "point1")))) },
                                                                                        "geodetic-2d" // TODO Use a Pixit
                                                                                        )
                                                                            },
                                                                          -,
                                                                          "urn:service:sos"
                                                                        )
                                          );

      
      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
        
        // Test Body
        tc_ac.start;

      f_receiveResponse(mw_http_list_services_by_location_response(
                                                        mw_list_services_by_location_response(
                                                                                              { "urn:service:sos.fire", "urn:service:sos.police" },
                                                                                              LibItsHttp_XmlTemplates.mw_path({ LibItsHttp_XmlTemplates.mw_via(PX_ECRF_VIA) }),
                                                                                              -,
                                                                                              mw_location_used(PX_LOCATION_ID)
                                                                                              )
                                                      )
                        );        
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_ECRF_LOST_BV_10


  } // End of group LOST

} // End of module AtsECRF_TestCases 
Loading