Commit 5ebb9134 authored by garciay's avatar garciay
Browse files

STF545: Finalyse first TC

parent dd73375a
Loading
Loading
Loading
Loading
+26 −0
Original line number Original line Diff line number Diff line
/**
 *    @author   ETSI / STF545
 *    @version  $URL$
 *              $ID:$
 *    @desc     This module provides the custom binary types for ITS HTTP based protocols.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 */
module LibItsHttp_BinaryMessageBodyTypes {
    
  /**
   * This file volontary contains a trivial declaration of the type BinaryBodu. 
   * In accordance with your TTCN-3 module LibItsHttp_XMLTypes, you have to change the BinaryBody typing.
   */
  // TODO Add here your custom binary import
  
  type union BinaryBody {
    // TODO Add here your custom variants
    octetstring        raw
  } with {
    variant ""
  }
      
} // End of LibItsHttp_BinaryMessageBodyTypes
+32 −0
Original line number Original line Diff line number Diff line
/**
 *    @author   ETSI / STF545
 *    @version  $URL$
 *              $ID:$
 *    @desc     This module provides the custom templates for ITS HTTP based protocols.
 *    @copyright   ETSI Copyright Notification
 *                 No part may be reproduced except as authorized by written permission.
 *                 The copyright and the foregoing restriction extend to reproduction in all media.
 *                 All rights reserved.
 */
module LibItsHttp_BinaryTemplates {
  
  // LibItsHttp
  import from LibItsHttp_BinaryMessageBodyTypes all;
    
  // TODO Add here your custom binary import 
    
  template (value) BinaryBody m_binary_body_raw(
                                                in template (value) octetstring p_raw
  ) := {
    raw := p_raw
  } // End of template m_binary_body_raw

  template (present) BinaryBody mw_binary_body_raw(
                                                   template (present) octetstring p_raw := ?
  ) := {
    raw := p_raw
  } // End of template mw_binary_body_raw
    
  // TODO Add here your custom binary template
  
} // End of module LibItsHttp_BinaryTemplates
+9 −0
Original line number Original line Diff line number Diff line
module LibItsHttp_BinaryTypes { // FIXME To be removed
    
    /**
     * This file is volontary empry. You have to declare all XSD files required by your project
     * In addition, the TTCN-3 module LibItsHttp_XmlMessageBodyTypes have to be updated too.
     */
    // TODO Add here your custom binary import
    
} // End of module LibItsHttp_BinaryTypes 
+2 −3
Original line number Original line Diff line number Diff line
@@ -2,15 +2,14 @@ module LibItsHttp_MessageBodyTypes {
  
  
  // LibHttp
  // LibHttp
  import from LibItsHttp_XmlMessageBodyTypes all;
  import from LibItsHttp_XmlMessageBodyTypes all;
  
  import from LibItsHttp_BinaryMessageBodyTypes all;
  type octetstring MsdBody;
  
  
  type charstring HtmlBody;
  type charstring HtmlBody;
  
  
  type charstring TextBody;
  type charstring TextBody;
  
  
  type union HttpMessageBody {
  type union HttpMessageBody {
      MsdBody     ms_body,
      BinaryBody  binary_body,
      HtmlBody    html_body,
      HtmlBody    html_body,
      XmlBody     xml_body,
      XmlBody     xml_body,
      TextBody    text_body
      TextBody    text_body
+30 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@ module LibItsHttp_Templates {
    import from LibItsHttp_TypesAndValues all;
    import from LibItsHttp_TypesAndValues all;
    import from LibItsHttp_MessageBodyTypes all;
    import from LibItsHttp_MessageBodyTypes all;
    import from LibItsHttp_XmlMessageBodyTypes all;
    import from LibItsHttp_XmlMessageBodyTypes all;
    import from LibItsHttp_BinaryMessageBodyTypes all;
    
    
    group http_messages {
    group http_messages {
        
        
@@ -71,6 +72,19 @@ module LibItsHttp_Templates {
          body          := p_body
          body          := p_body
        } // End of template m_http_request_get
        } // End of template m_http_request_get
        
        
        template (omit) Request m_http_request_post(
                                                    in charstring p_uri, 
                                                    in template (value) HeaderLines p_headers,
                                                    in template (omit) HttpMessageBody p_body := omit
        ) := {
          method        := "POST",
          uri           := p_uri,
          version_major := c_http_version_major,
          version_minor := c_http_version_minor,
          header        := p_headers,
          body          := p_body
        } // End of template m_http_request_post
        
    } // End of group http_requests
    } // End of group http_requests
    
    
    group http_responses {
    group http_responses {
@@ -105,4 +119,20 @@ module LibItsHttp_Templates {
      
      
    } // End of group http_xml_body
    } // End of group http_xml_body
    
    
    group http_binary_body {
      
      template (value) HttpMessageBody m_http_message_body_binary(
                                                                  in template (value) BinaryBody p_binary_body
      ) := {
          binary_body := p_binary_body
      } // End of template m_http_message_body_binary
      
      template (present) HttpMessageBody mw_http_message_body_binary(
                                                                     template (present) BinaryBody p_binary_body := ?
      ) := {
          binary_body := p_binary_body
      } // End of template mw_http_message_body_binary
      
    } // End of group http_binary_body
    
} // End of module LibItsHttp_Templates
} // End of module LibItsHttp_Templates
Loading