# File lib/adaptation/test/test_help.rb, line 96
  def assert_message_published xml_message
    message_object = xml_message

    if message_object.is_a?(String)
      # build Message object with xml_data
      message_type = xml_message[1..(xml_message.index(/(>| )/) - 1)]
      message_class = Adaptation::Message.get_class_object(message_type.capitalize)
      message_object = message_class.to_object(xml_message)
    end

    # check for all messages "published" in the mom (that's file /tmp/mom.txt),
    # if any line corresponds to the message passed as a parameter.
    message_found = false
    expected = published = ""
    File.open(ADAPTOR_ROOT + '/test/mocks/test/mom.txt', 'r').each{ |line|
      mom_message = REXML::Document.new line
      published   =  line.chop
      expected    =  message_object.to_xml.to_s
      if compare_xml_elements mom_message.root, message_object.to_xml
        message_found = true
        break 
      end
    }
 
    error = build_message(error,
      "? message not published:\n \
  Expected : ?\n \
  Published: ?\n",
      message_object.class,
      expected,
      published)
    assert_block error do
      message_found
    end
    
  end