<commit_before>#!/bin/bash

_input="src/main/resources/org/fiteagle/delivery/xmlrpc/sfa_getVersion.xml"
_url_plain="http://localhost:9111/xmlrpc/"
_url_ssl="https://localhost:9112/xmlrpc/"

function sendRequest {
  echo "Sending request to ${1}..."
  echo " * Content: ${2}"
  echo " * Answer: "
  echo "-------------------------------"
  curl -k --data @${2} ${1}
  result=$?
  echo "-------------------------------"
  echo ""
  return $result
}

function assertEqual {
  actual=$1; expected=$2;
  if [ "$actual" != "$expected" ]; then
    echo "FAILED. Expected error code $expected. I got: $actual."
    exit 1
  fi
}

sendRequest ${_url_plain} ${_input}
actual=$?; expected="0"; assertEqual $actual $expected;

sendRequest ${_url_ssl} ${_input}
actual=$?; expected="35"; assertEqual $actual $expected;

exit 0<commit_msg>maybe we'll have a key later<commit_after>#!/bin/bash

_input="src/main/resources/org/fiteagle/delivery/xmlrpc/sfa_getVersion.xml"
_url_plain="http://localhost:9111/xmlrpc/"
_url_ssl="https://localhost:9112/xmlrpc/"

function sendRequest {
  echo "Sending request to ${1}..."
  echo " * Content: ${2}"
  echo " * Answer: "
  echo "-------------------------------"
  if [ "${3}" == "" ]; then
    curl -k --data @${2} ${1}
  else
    curl -k --data @${2} --key ${3} ${1}
  fi
  result=$?
  echo "-------------------------------"
  echo ""
  return $result
}

function assertEqual {
  actual=$1; expected=$2;
  if [ "$actual" != "$expected" ]; then
    echo "FAILED. Expected error code $expected. I got: $actual."
    exit 1
  fi
}

sendRequest ${_url_plain} ${_input}
actual=$?; expected="0"; assertEqual $actual $expected;

sendRequest ${_url_ssl} ${_input}
actual=$?; expected="35"; assertEqual $actual $expected;

//sendRequest ${_url_ssl} ${_input} ${_key} 

exit 0
{'fraction_non_alphanumeric': 0.24470457079152733, 'fraction_numerical': 0.023411371237458192, 'mean_word_length': 2.9106753812636166, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '12146', 'n_tokens_mistral': 624, 'n_tokens_neox': 609, 'n_words': 150}