Commit 57b89eda authored by Yann Garcia's avatar Yann Garcia
Browse files

Add dummy test case TC_CDM_CISE_SIMU_EI_NA_PULL_BV_01 to simulate peer Adapter

parent f1a1a6a7
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -6,6 +6,8 @@ LibCise_Pics.PICS_IUT_CDM_NODE_EI_NA := true
LibCise_Pics.PICS_IUT_CDM_NODE_EI_NN := false
LibCise_Pics.PICS_IUT_CDM_ADAPTOR    := true

LibCise_Pics.PICS_IUT_CDM_CISE_SIMU_EI_NA := false

# Communication messages
LibCise_Pics.PICS_CDM_PULL            := true
LibCise_Pics.PICS_CDM_PUSH            := true
@@ -49,8 +51,8 @@ LibCise_Pics.PICS_CISE_ADAPTOR_URI := "/cise-adapter/api/v1/messages"
# Asynchronous Ack
LibCise_Pixits.PX_CISE_REQUEST_ACK := false
# Services
LibCise_Pixits.PX_CISE_SENDER_SERVICE_ID    := "de.sim2-node01.vessel.pull.consumer"
LibCise_Pixits.PX_CISE_RECIPIENT_SERVICE_ID := "de.sim1-node01.vessel.pull.provider"
LibCise_Pixits.PX_CISE_SENDER_SERVICE_ID    := "de.testsystem1.vessel.pull.consumer"
LibCise_Pixits.PX_CISE_RECIPIENT_SERVICE_ID := "de.testsystem1.vessel.pull.provider"
# Discovery
LibCise_Pixits.PX_CISE_DISCOVERY_PROFILE_SERVICE_ID := "cx.simlsa3-nodecx.vessel.push.consumer"
LibCise_Pixits.PX_CISE_SEA_BASSIN                   := mediterranean
@@ -67,8 +69,8 @@ LibCise_Pixits.PX_VESSEL_NET_TONNAGE := 30000.0
LibCise_Pixits.PX_ORGANIZATION_LEGAL_NAME := "A1"
LibCise_Pixits.PX_ORGANIZATION_UUID       := "787aa3e9b91b-5bc2-0cf5-80a8-183a716b8d59"
# Period
LibCise_Pixits.PX_PERIOD_START_DATE := "2023-09-01+01:00"
LibCise_Pixits.PX_PERIOD_END_DATE   := "2023-09-01+01:00"
LibCise_Pixits.PX_PERIOD_START_DATE := "2024-02-01+01:00"
LibCise_Pixits.PX_PERIOD_END_DATE   := "2024-09-01+01:00"

# Incident
LibCise_Pixits.PX_IRREGULAR_MIGRATION_INCIDENT_TYPE := irregularBorderEntry
@@ -144,7 +146,7 @@ system.utPort.params := "HTTP(codecs=xml:xml_codec;json:json_codec)/TCP(debug=1,

## cise_node_ei_na
# Check that the IUT responds with an HTTP 200 OK Acknowledgment response when receiving a PullRequest for Vessel service - no Acknowledgment required
AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BV_01_01
#AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BV_01_01
# Check that the IUT sends a PullResponse before reponse timout expiry when receiving a PullRequest with timeout on response - no Acknowledgment required
#AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BV_01_02
# Check that the IUT responds with an HTTP 200 OK Acknowledgment response when receiving a PullRequest for a unknown vessel - no Acknowledgment required
@@ -162,7 +164,7 @@ AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BV_01_01
# Check that the IUT responds with an HTTP 200 OK Acknowledgment response and an error code when receiving a PullRequest with a  date/time far in future (one month)
#AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BO_01_05
# Check that the IUT responds with an HTTP 200 OK Acknowledgment response and an error code when receiving a PullRequest with an invalid filter (Selector entry does not exist)
#AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BO_01_06
AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BO_01_06

# Check that the IUT responds with an HTTP 200 OK Acknowledgment response when receiving a PullRequest for Action service - no Acknowledgment required
#AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BV_02_01
@@ -475,6 +477,9 @@ AtsCise_TestCases.TC_CDM_NODE_EI_NA_PULL_REQUEST_BV_01_01
#AtsCise_TestCases.TC_CDM_NODE_EI_NA_SEC_BO_08


# Simulate peer adapter of CISE node IUT
#AtsCise_TestCases.TC_CDM_CISE_SIMU_EI_NA_PULL_BV_01

[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.
+2 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ module AtsCise_Templates {
                                                                              in template (omit) XSD.Boolean p_ensureEncryption := false,
                                                                              in template (omit) Vessel p_vessel := m_vessel(
                                                                                                                             -, -, -, -, -, -, -, -, -, -, // TODO Reorganize the template arguments order
                                                                                                                             { PX_VESSEL_TYPE },
                                                                                                                             -, // FIXME Initialization of a record of template with an unbound value with { PX_VESSEL_TYPE },
                                                                                                                             -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -, -,
                                                                                                                             PX_VESSEL_NET_TONNAGE
                                                                                                                             ),
+106 −0
Original line number Diff line number Diff line
@@ -17781,4 +17781,110 @@ module AtsCise_TestCases {
  } // End of group security
  group cise_simu {
    
      /**
       * @desc Simulate peer adapter of CISE node IUT
       */
      testcase TC_CDM_CISE_SIMU_EI_NA_PULL_BV_01() runs on CiseComponent system CiseTestAdapter {
        // Local variables
        var HttpMessage v_request;
        var Headers v_headers;
        var charstring v_created_date_time := f_get_current_date_time();
        var charstring v_expected_date_time := substr(v_created_date_time, 0, lengthof(v_created_date_time) - 5);
        var charstring v_message_id := f_generate_uuid();
        var charstring v_correlation_id := f_generate_uuid();
        var integer v_result;
        // Test control
        if (not(PICS_IUT_CDM_CISE_SIMU_EI_NA) or not(PICS_CDM_PULL) or not(PICS_CDM_VESSEL_SERVICE)) {
          log("*** " & testcasename() & ": PICS_IUT_CDM_CISE_SIMU_EI_NA and PICS_CDM_PULL and PICS_CDM_VESSEL_SERVICE required for executing the TC ***");
          setverdict(inconc);
          stop;
        }
        // Test component configuration
        f_cf_02_up();
        // Test adapter configuration
        // Preamble
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        // Test Body
        tc_ac.start;
        alt {
          [] httpPort_notif.receive(
                                    mw_http_request(
                                                    mw_http_request_post(
                                                                         ?,
                                                                         ?,
                                                                         mw_http_message_body_xml(
                                                                                                  mw_xml_body_pull_request
                                   )))) -> value v_request {
            tc_ac.stop;
            // Skip Securty
            // Send the response to finalyze the transaction
            f_init_default_headers_list(-, -, v_headers);
            httpPort_notif.send(
                                m_http_response(
                                                m_http_response_ok(
                                                                   m_http_message_body_xml(
                                                                                           m_xml_body_acknowledgement(
                                                                                                                      m_acknowledgement(
                                                                                                                                        v_request.request.body.xml_body.msg.pull_request.creationDateTime,
                                                                                                                                        v_request.request.body.xml_body.msg.pull_request.messageID,
                                                                                                                                        v_request.request.body.xml_body.msg.pull_request.priority,
                                                                                                                                        {},
                                                                                                                                        success
                                                                                            ))),
                                                                                            v_headers
                                )));
            // Message processing
            f_sleep(PX_MESSAGE_PROCESSING_INTERVAL);
            // Send PullResponse
            f_init_default_headers_list(-, -, v_headers);
            httpPort_notif.send(
                                m_http_response(
                                                m_http_response_ok(
                                                                   m_http_message_body_xml(
                                                                                            m_xml_body_pull_response(
                                                                                                                    m_pull_response(
                                                                                                                                    v_created_date_time,
                                                                                                                                    v_message_id,
                                                                                                                                    v_request.request.body.xml_body.msg.pull_request.priority,
                                                                                                                                    v_request.request.body.xml_body.msg.pull_request.sender_,
                                                                                                                                    {},
                                                                                                                                    success,
                                                                                                                                    -,
                                                                                                                                    -,
                                                                                                                                    v_request.request.body.xml_body.msg.pull_request.contextID,
                                                                                                                                    v_request.request.body.xml_body.msg.pull_request.correlationID,
                                                                                                                                    false
                                                                                            ))),
                                                                                            v_headers
                                )));
          }
          [] httpPort_notif.receive {
            tc_ac.stop;
            log("*** " & testcasename() & ": FAIL: Unexpected message received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);           
          }
          [] tc_ac.timeout {
            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
          }
        } // End of 'alt' statement
        // Postamble
        f_cf_02_down();
      } // End of testcase TC_CDM_CISE_SIMU_EI_NA_PULL_BV_01
  } // End of group cise_simu
} // End of module AtsCise_TestCases
+6 −0
Original line number Diff line number Diff line
@@ -205,4 +205,10 @@ module LibCise_Pics {

  modulepar charstring PICS_HEADER_HOST_UT := "127.0.0.1";

  /**
   * @desc Set to true if the IUT is acting as a peer CISE adaptor
   * @see Not documented
   */
  modulepar boolean PICS_IUT_CDM_CISE_SIMU_EI_NA := false;

} // End of module LibCise_Pics