spec/liberty_buildpack/services/mongo_spec.rb
def check_server_xml_create(root, sm)
        server_xml = File.join(root, 'server.xml')
        server_xml_doc = REXML::Document.new('<server><featureManager/></server>')

        sm.update_configuration(server_xml_doc, true, root)

        File.open(server_xml, 'w') { |file| server_xml_doc.write(file) }

        expected_config = []
        expected_config << '<feature>mongodb-2.0</feature>'
        expected_config << "<mongo hostNames='#{@test_hosts}' id='#{get_mongo_id}' libraryRef='#{get_lib_id}' password='#{get_password}' ports='#{@test_ports}' user='#{get_user}'/>"
        expected_config << "<mongoDB databaseName='#{get_db}' id='#{get_mongodb_id}' jndiName='#{get_jndi}' mongoRef='#{get_mongo_id}'/>"
        expected_config << "<library id='#{get_lib_id}'><fileset dir='#{get_lib_dir}' id='#{get_fileset_id}'/></library>"
        validate_xml(server_xml, expected_config)
      end
#----------------------------------------------------------
# Helper methods to return constants used in checking server.xml contents
#----------------------------------------------------------
Helper methods to return constants used in checking server.xml contents
Helper methods to return constants used in checking server . xml contents
def check_server_xml_create(root, sm)
        server_xml = File.join(root, 'server.xml')
        server_xml_doc = REXML::Document.new('<server><featureManager/></server>')
        sm.update_configuration(server_xml_doc, true, root)
        File.open(server_xml, 'w') { |file| server_xml_doc.write(file) }
        expected_config = []
        expected_config << '<feature>mongodb-2.0</feature>'
        expected_config << "<mongo hostNames='#{@test_hosts}' id='#{get_mongo_id}' libraryRef='#{get_lib_id}' password='#{get_password}' ports='#{@test_ports}' user='#{get_user}'/>"
        expected_config << "<mongoDB databaseName='#{get_db}' id='#{get_mongodb_id}' jndiName='#{get_jndi}' mongoRef='#{get_mongo_id}'/>"
        expected_config << "<library id='#{get_lib_id}'><fileset dir='#{get_lib_dir}' id='#{get_fileset_id}'/></library>"
        validate_xml(server_xml, expected_config)
      end
def check_server_xml_create ( root , sm ) server_xml = File . join ( root , 'server.xml' ) server_xml_doc = REXML :: Document . new ( '<server><featureManager/></server>' ) sm . update_configuration ( server_xml_doc , true , root ) File . open ( server_xml , 'w' ) { | file | server_xml_doc . write ( file ) } expected_config = [ ] expected_config << '<feature>mongodb-2.0</feature>' expected_config << "<mongo hostNames='#{@test_hosts}' id='#{get_mongo_id}' libraryRef='#{get_lib_id}' password='#{get_password}' ports='#{@test_ports}' user='#{get_user}'/>" expected_config << "<mongoDB databaseName='#{get_db}' id='#{get_mongodb_id}' jndiName='#{get_jndi}' mongoRef='#{get_mongo_id}'/>" expected_config << "<library id='#{get_lib_id}'><fileset dir='#{get_lib_dir}' id='#{get_fileset_id}'/></library>" validate_xml ( server_xml , expected_config ) end
Helper methods to return constants used in checking server.xml contents
Helper methods to return constants used in checking server . xml contents
root
sm