Commit 5a7fd027 authored by Michael Proestler's avatar Michael Proestler
Browse files

Add TC_ECRF_LOST_BI_03

Add badRequest pixit and template
parent 94c52a90
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ module AtsECRF_Functions {
	import from LibItsHttp_Functions all;
	import from LibItsHttp_TypesAndValues all;
	import from LibItsHttp_XmlTemplates all;
  import from LibItsHttp_MessageBodyTypes all;
	
	import from LibCommon_Sync all;

@@ -116,6 +117,30 @@ module AtsECRF_Functions {
  }    


  function f_sendRawRequest(template (value) TextBody p_text_body) 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,
                                                         { text_body := p_text_body}
                                                         )
                                     )
                      );
  }

	function f_receiveResponse(template HttpMessage p_message) runs on HttpComponent return HttpMessage {
	  var HttpMessage v_response;

+2 −0
Original line number Diff line number Diff line
@@ -127,4 +127,6 @@ module AtsECRF_Pixits {
  modulepar XSD.String PX_DISPLAY_NAME_FIRE_G1 := "Fire G1";  
  modulepar XSD.AnyURI PX_SOURCE_ID_FIRE_G1 := "1d2af31b-4f75-4277-871a-dd3fad15b002";  


  modulepar charstring PX_INVALID_REQUEST := "<?xml version=\"1.0\" encoding=\"UTF-8\"?><invalid>xml";
} // End of module AtsECRF_Pixits 
+33 −1
Original line number Diff line number Diff line
@@ -1086,7 +1086,39 @@ module AtsECRF_TestCases {
      );     
        // Postamble
        f_cf_01_http_down();
    } // End of testcase TC_ECRF_LOST_BV_10
    } // End of testcase TC_ECRF_LOST_BI_02

    /**
    * @desc "IUT responds to a findServiceRequest with an badRequest error response"
    */
    testcase TC_ECRF_LOST_BI_03() runs on HttpComponent system TestAdapter {
      
      // Test control
      f_check_statements({
        { name := "PICS_ECRF_FIND_SERVICE", val := PICS_ECRF_FIND_SERVICE }        
      })

      // Test component configuration
      f_cf_01_http_up();

      // Preamble
      f_sendRawRequest(PX_INVALID_REQUEST);              

      f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);

      // Test Body
      tc_ac.start;
      f_receiveResponse(mw_http_find_service_response_error(
                                                            mw_exception_badRequest(
                                                                PX_ECRF_NAPTR,
                                                                mw_basic_exception
                                                            )
                        )
      );

      // Postamble
      f_cf_01_http_down();
    }

  }

+11 −1
Original line number Diff line number Diff line
@@ -723,7 +723,17 @@ module LibItsHttp_XmlTemplates {
      source       := p_source,
      choice_list  := { { loop := p_loop } },
      notLost_list := p_notLost_list
    } // End of template mw_exception_locationProfileUnrecognized
    } // End of template mw_exception_loop

    template (present) ExceptionContainer mw_exception_badRequest(
                                                                                   template (present) AppUniqueString p_source := ?,
                                                                                   template (present) BadRequest p_bad := ?,
                                                                                   template (present) ExceptionContainer.notLost_list p_notLost_list := ?
                                                                                   ) := {
      source       := p_source,
      choice_list  := { { badRequest := p_bad } },
      notLost_list := p_notLost_list
    } // End of template mw_exception_badRequest  

    template (value) LocationUsed m_location_used(
                                                  in template (value) XSD.Token p_id