test/unit/searcher_benchmarks.rb in exlibris-primo-0.1.1 vs test/unit/searcher_benchmarks.rb in exlibris-primo-0.1.4

- old
+ new

@@ -1,31 +1,29 @@ require 'test_helper' -class SearcherTest < ActiveSupport::TestCase +class SearcherTest < Test::Unit::TestCase PNX_NS = {'pnx' => 'http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib'} SEARCH_NS = {'search' => 'http://www.exlibrisgroup.com/xsd/jaguar/search'} def setup @primo_definition = YAML.load( %{ - type: PrimoService - priority: 2 # After SFX, to get SFX metadata enhancement - status: active - base_url: http://bobcat.library.nyu.edu - vid: NYU - institution: NYU - holding_search_institution: NYU - holding_search_text: Search for this title in BobCat. - suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ] - ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/' - service_types: - - primo_source - - holding_search - - fulltext - - table_of_contents - - referent_enhance - - cover_image - }) - + type: PrimoService + priority: 2 # After SFX, to get SFX metadata enhancement + status: active + base_url: http://bobcat.library.nyu.edu + vid: NYU + institution: NYU + holding_search_institution: NYU + holding_search_text: Search for this title in BobCat. + suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ] + ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/' + service_types: + - primo_source + - holding_search + - fulltext + - table_of_contents + - referent_enhance + - cover_image }) @base_url = @primo_definition["base_url"] @vid = @primo_definition["vid"] @institution = @primo_definition["institution"] @primo_holdings_doc_id = "nyu_aleph000062856" @primo_rsrcs_doc_id = "nyu_aleph002895625" @@ -47,20 +45,14 @@ @primo_test_genre = "Book" @searcher_setup = { :base_url => @base_url, :institution => @institution, :vid => @vid, - :config => @primo_config + :config => @primo_definition } - - @searcher_setup_without_config = { - :base_url => @base_url, - :institution => @institution, - :vid => @vid - } end - test "benchmarks" do + def testbenchmarks Benchmark.bmbm do |results| results.report("Primo Searcher:") { (1..10).each { searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_holdings_doc_id}) } \ No newline at end of file