umlaut 3.0.0alpha9 → 3.0.0alpha10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/app/controllers/umlaut_controller.rb +5 -0
  2. data/app/models/collection.rb +90 -54
  3. data/app/models/referent.rb +30 -17
  4. data/app/models/service_wave.rb +59 -41
  5. data/lib/exlibris/primo/holding.rb +3 -9
  6. data/lib/exlibris/primo/related_link.rb +17 -0
  7. data/lib/exlibris/primo/searcher.rb +52 -31
  8. data/lib/exlibris/primo/source/distribution/nyu_aleph.rb +59 -38
  9. data/lib/exlibris/primo_ws.rb +1 -1
  10. data/lib/service.rb +1 -1
  11. data/lib/service_adaptors/primo_service.rb +38 -5
  12. data/lib/service_adaptors/primo_source.rb +2 -2
  13. data/lib/service_adaptors/sfx.rb +11 -0
  14. data/lib/term_color.rb +9 -2
  15. data/lib/umlaut/version.rb +1 -1
  16. data/lib/umlaut_configurable.rb +9 -0
  17. data/test/dummy/config/umlaut_services.yml +20 -0
  18. data/test/dummy/tmp/cache/assets/CDC/680/sprockets%2F2b68ef632d12610f3c9563168bfa7c05 +0 -0
  19. data/test/dummy/tmp/cache/assets/CF5/9B0/sprockets%2F7933bfe880731b396791f1682ce3f7fa +0 -0
  20. data/test/dummy/tmp/cache/assets/CFB/2F0/sprockets%2F62d51f0aa5cac4b1cf7091823772a604 +0 -0
  21. data/test/dummy/tmp/cache/assets/D4C/0A0/sprockets%2F7810d837eec3ac57ad78756af83a6a55 +0 -0
  22. data/test/dummy/tmp/cache/assets/D4C/E30/sprockets%2F631abf89746799b7a5b2b3b4f6294bcd +0 -0
  23. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  24. data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
  25. data/test/dummy/tmp/cache/assets/D70/080/sprockets%2F24d3ce40ae5cc827a9183b1fb837e84e +0 -0
  26. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  27. data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
  28. data/test/unit/aleph_patron_test.rb +6 -6
  29. data/test/unit/aleph_record_benchmarks.rb +1 -1
  30. data/test/unit/aleph_record_test.rb +4 -4
  31. data/test/unit/primo_searcher_test.rb +90 -82
  32. data/test/unit/primo_service_test.rb +683 -680
  33. data/test/unit/primo_ws_test.rb +45 -32
  34. metadata +135 -155
  35. data/lib/tasks/#Untitled-1# +0 -1843
  36. data/test/dummy/out +0 -5
@@ -1,13 +1,15 @@
1
1
  require "benchmark"
2
+ require 'test_helper'
3
+ class PrimoSearcherTest < Test::Unit::TestCase
4
+ PNX_NS = {'pnx' => 'http://www.exlibrisgroup.com/xsd/primo/primo_nm_bib'}
5
+ SEARCH_NS = {'search' => 'http://www.exlibrisgroup.com/xsd/jaguar/search'}
2
6
 
3
- require File.dirname(__FILE__) + '/../test_helper'
4
- class PrimoSearcherTest < ActiveSupport::TestCase
5
7
  def setup
6
8
  @primo_definition = YAML.load( %{
7
9
  type: PrimoService
8
10
  priority: 2 # After SFX, to get SFX metadata enhancement
9
11
  status: active
10
- base_url: http://bobcatdev.library.nyu.edu
12
+ base_url: http://bobcat.library.nyu.edu
11
13
  vid: NYU
12
14
  institution: NYU
13
15
  holding_search_institution: NYU
@@ -25,6 +27,7 @@ class PrimoSearcherTest < ActiveSupport::TestCase
25
27
 
26
28
  @base_url = @primo_definition["base_url"]
27
29
  @vid = @primo_definition["vid"]
30
+ @institution = @primo_definition["institution"]
28
31
  @primo_holdings_doc_id = "nyu_aleph000062856"
29
32
  @primo_rsrcs_doc_id = "nyu_aleph002895625"
30
33
  @primo_tocs_doc_id = "nyu_aleph003149772"
@@ -43,43 +46,49 @@ class PrimoSearcherTest < ActiveSupport::TestCase
43
46
  @primo_test_title = "Travels with My Aunt"
44
47
  @primo_test_author = "Graham Greene"
45
48
  @primo_test_genre = "Book"
46
- @primo_config = YAML.load_file("#{Rails.root}/config/umlaut_config/primo.yml")
49
+ @primo_config = YAML.load_file("#{Rails.root}/config/primo.yml")
47
50
  @searcher_setup = {
48
51
  :base_url => @base_url,
52
+ :institution => @institution,
49
53
  :vid => @vid,
50
54
  :config => @primo_config
51
55
  }
52
- aleph_helper = Exlibris::Aleph::Config::Helper.instance()
56
+
57
+ @searcher_setup_without_config = {
58
+ :base_url => @base_url,
59
+ :institution => @institution,
60
+ :vid => @vid
61
+ }
53
62
  end
54
63
 
55
- def test_primo_searcher_benchmarks
56
- Benchmark.bmbm do |results|
57
- results.report("Primo Searcher:") {
58
- (1..10).each {
59
- searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_holdings_doc_id})
60
- }
61
- }
62
- searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_holdings_doc_id})
63
- results.report("Searcher#process_record") {
64
- (1..10).each {
65
- searcher.send(:process_record)
66
- }
67
- }
68
- results.report("Searcher#process_search_results") {
69
- (1..10).each {
70
- searcher.send(:process_search_results)
71
- }
72
- }
73
- end
74
- end
64
+ # def test_primo_searcher_benchmarks
65
+ # Benchmark.bmbm do |results|
66
+ # results.report("Primo Searcher:") {
67
+ # (1..10).each {
68
+ # searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_holdings_doc_id})
69
+ # }
70
+ # }
71
+ # searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_holdings_doc_id})
72
+ # results.report("Searcher#process_record") {
73
+ # (1..10).each {
74
+ # searcher.send(:process_record)
75
+ # }
76
+ # }
77
+ # results.report("Searcher#process_search_results") {
78
+ # (1..10).each {
79
+ # searcher.send(:process_search_results)
80
+ # }
81
+ # }
82
+ # end
83
+ # end
75
84
 
76
85
  # Test search for a single Primo document.
77
86
  def test_search_by_doc_id
78
87
  searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_holdings_doc_id})
79
88
  assert_not_nil(searcher, "#{searcher.class} returned nil when instantiated.")
80
89
  search_results = searcher.response
81
- assert_instance_of(Hpricot::Doc, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
82
- assert_equal(@primo_holdings_doc_id, search_results.at("//control/recordid").inner_text, "#{searcher.class} returned an unexpected record: #{search_results.to_original_html}")
90
+ assert_instance_of(Nokogiri::XML::Document, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
91
+ assert_equal(@primo_holdings_doc_id, search_results.at("//pnx:control/pnx:recordid", PNX_NS).inner_text, "#{searcher.class} returned an unexpected record: #{search_results.to_xml(:indent => 5, :encoding => 'UTF-8')}")
83
92
  assert(searcher.count.to_i > 0, "#{searcher.class} returned 0 results for doc id: #{@primo_holdings_doc_id}.")
84
93
  end
85
94
 
@@ -88,8 +97,8 @@ class PrimoSearcherTest < ActiveSupport::TestCase
88
97
  searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_test_problem_doc_id})
89
98
  assert_not_nil(searcher, "#{searcher.class} returned nil when instantiated.")
90
99
  search_results = searcher.response
91
- assert_instance_of(Hpricot::Doc, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
92
- assert_equal(@primo_test_problem_doc_id, search_results.at("//control/recordid").inner_text, "#{searcher.class} returned an unexpected record: #{search_results.to_original_html}")
100
+ assert_instance_of(Nokogiri::XML::Document, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
101
+ assert_equal(@primo_test_problem_doc_id, search_results.at("//pnx:control/pnx:recordid", PNX_NS).inner_text, "#{searcher.class} returned an unexpected record: #{search_results.to_xml(:indent => 5, :encoding => 'UTF-8')}")
93
102
  assert(searcher.count.to_i > 0, "#{searcher.class} returned 0 results for doc id: #{@primo_test_problem_doc_id}.")
94
103
  assert_equal(1, searcher.holdings.length, "#{searcher.class} returned unexpected holdings")
95
104
  end
@@ -98,8 +107,8 @@ class PrimoSearcherTest < ActiveSupport::TestCase
98
107
  searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:primo_id => @primo_test_bug1361_id})
99
108
  assert_not_nil(searcher, "#{searcher.class} returned nil when instantiated.")
100
109
  search_results = searcher.response
101
- assert_instance_of(Hpricot::Doc, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
102
- assert_equal(@primo_test_bug1361_id, search_results.at("//control/recordid").inner_text, "#{searcher.class} returned an unexpected record: #{search_results.to_original_html}")
110
+ assert_instance_of(Nokogiri::XML::Document, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
111
+ assert_equal(@primo_test_bug1361_id, search_results.at("//pnx:control/pnx:recordid", PNX_NS).inner_text, "#{searcher.class} returned an unexpected record: #{search_results.to_xml(:indent => 5, :encoding => 'UTF-8')}")
103
112
  assert(searcher.count.to_i > 0, "#{searcher.class} returned 0 results for doc id: #{@primo_test_bug1361_id}.")
104
113
  assert_equal(0, searcher.holdings.length, "#{searcher.class} returned unexpected holdings")
105
114
  assert_equal(4, searcher.rsrcs.length, "#{searcher.class} returned unexpected rsrcs")
@@ -128,7 +137,7 @@ class PrimoSearcherTest < ActiveSupport::TestCase
128
137
 
129
138
  # Test base setup search for a single Primo document.
130
139
  def test_search_base_setup_record_id
131
- searcher = Exlibris::Primo::Searcher.new({:base_url => @base_url}, {:primo_id => @primo_holdings_doc_id})
140
+ searcher = Exlibris::Primo::Searcher.new({:base_url => @base_url, :institution => @institution}, {:primo_id => @primo_holdings_doc_id})
132
141
  holdings = searcher.holdings
133
142
  assert_instance_of(Array, holdings, "#{searcher.class} holdings is an unexpected object: #{holdings.class}")
134
143
  assert(holdings.count > 0, "#{searcher.class} returned 0 holdings for doc id: #{@primo_holdings_doc_id}.")
@@ -146,21 +155,21 @@ class PrimoSearcherTest < ActiveSupport::TestCase
146
155
  searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:isbn => @primo_test_isbn})
147
156
  assert_not_nil(searcher, "#{searcher.class} returned nil when instantiated.")
148
157
  search_results = searcher.response
149
- assert_instance_of(Hpricot::Doc, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
158
+ assert_instance_of(Nokogiri::XML::Document, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
150
159
  search_results.search("//search/isbn") do |isbn|
151
- assert_not_nil(isbn.inner_text.match(@primo_test_isbn), "#{searcher.class} returned an unexpected record: #{search_results.to_original_html}")
160
+ assert_not_nil(isbn.inner_text.match(@primo_test_isbn), "#{searcher.class} returned an unexpected record: #{search_results.to_xml(:indent => 5, :encoding => 'UTF-8')}")
152
161
  end
153
162
  assert(searcher.count.to_i > 0, "#{searcher.class} returned 0 results for ISBN: #{@primo_test_isbn}.")
154
163
  end
155
164
 
156
165
  # Test search by isbn.
157
166
  def test_search_by_issn
158
- searcher = Exlibris::Primo::Searcher.new({:base_url => "http://bobcatdev.library.nyu.edu", :vid => "NYU"}, {:issn => "0002-8614"})
167
+ searcher = Exlibris::Primo::Searcher.new(@searcher_setup_without_config, {:issn => "0002-8614"})
159
168
  assert_not_nil(searcher, "#{searcher.class} returned nil when instantiated.")
160
169
  search_results = searcher.response
161
- assert_instance_of(Hpricot::Doc, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
170
+ assert_instance_of(Nokogiri::XML::Document, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
162
171
  search_results.search("//search/issn") do |isbn|
163
- assert_not_nil(isbn.inner_text.match("0002-8614"), "#{searcher.class} returned an unexpected record: #{search_results.to_original_html}")
172
+ assert_not_nil(isbn.inner_text.match("0002-8614"), "#{searcher.class} returned an unexpected record: #{search_results.to_xml(:indent => 5, :encoding => 'UTF-8')}")
164
173
  end
165
174
  assert(searcher.count.to_i > 0, "#{searcher.class} returned 0 results for ISSN: 0002-8614.")
166
175
  end
@@ -170,9 +179,9 @@ class PrimoSearcherTest < ActiveSupport::TestCase
170
179
  searcher = Exlibris::Primo::Searcher.new(@searcher_setup, {:title => @primo_test_title, :author => @primo_test_author, :genre => @primo_test_genre})
171
180
  assert_not_nil(searcher, "#{searcher.class} returned nil when instantiated.")
172
181
  search_results = searcher.response
173
- assert_instance_of(Hpricot::Doc, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
182
+ assert_instance_of(Nokogiri::XML::Document, search_results, "#{searcher.class} search result is an unexpected object: #{search_results.class}")
174
183
  search_results.search("//search/title") do |title|
175
- assert_not_nil(title.inner_text.downcase.match(@primo_test_title.downcase), "#{searcher.class} returned an unexpected record: #{search_results.to_original_html}")
184
+ assert_not_nil(title.inner_text.downcase.match(@primo_test_title.downcase), "#{searcher.class} returned an unexpected record: #{search_results.to_xml(:indent => 5, :encoding => 'UTF-8')}")
176
185
  end
177
186
  assert(searcher.count.to_i > 0, "#{searcher.class} returned 0 results for Title: #{@primo_test_title}.")
178
187
  end
@@ -240,7 +249,7 @@ class PrimoSearcherTest < ActiveSupport::TestCase
240
249
  test_data = {
241
250
  :record_id => "nyu_aleph002895625",
242
251
  :v => nil,
243
- :url => "http://ezproxy.library.nyu.edu:2048/login?url=http://mq.oxfordjournals.org/",
252
+ :url => "https://ezproxy.library.nyu.edu/login?url=http://mq.oxfordjournals.org/",
244
253
  :display => "Online Version",
245
254
  :institution_code => "NYU",
246
255
  :origin => nil,
@@ -288,7 +297,7 @@ class PrimoSearcherTest < ActiveSupport::TestCase
288
297
  holdings = searcher.holdings
289
298
  assert_instance_of(Array, holdings,
290
299
  "#{searcher.class} holdings is an unexpected object: #{holdings.class}")
291
- assert_equal(7, holdings.count,
300
+ assert_equal(6, holdings.count,
292
301
  "#{searcher.class} returned 0 holdings for doc id: #{@primo_dedupmrg_doc_id}.")
293
302
  first_holding = holdings.first
294
303
  assert_instance_of(
@@ -350,54 +359,53 @@ class PrimoSearcherTest < ActiveSupport::TestCase
350
359
  }
351
360
  end
352
361
 
353
- def test_holdings_diacritics1
354
- searcher = Exlibris::Primo::Searcher.new(
355
- @searcher_setup,
356
- { :primo_id => @primo_test_diacritics1_doc_id })
357
- assert_equal(
358
- "Rubāʻīyāt-i Bābā Ṭāhir",
359
- searcher.btitle,
360
- "#{searcher.class} has an unexpected btitle: #{searcher.btitle}")
361
- assert_equal(
362
- "Bābā-Ṭāhir, 11th cent",
363
- searcher.au,
364
- "#{searcher.class} has an unexpected author: #{searcher.au}")
365
- end
366
-
367
- # This test fails but I don't know why!
368
- def test_holdings_diacritics2
369
- searcher = Exlibris::Primo::Searcher.new(
370
- @searcher_setup,
371
- { :primo_id => @primo_test_diacritics2_doc_id })
372
- assert_equal(
373
- "أقليم توات خلال القرنين الثامن عشر والتاسع عشر الميلاديين : دراسة لأوضاع الأقليم السياسية والأجتماعية والأقتصادية والثقافية، مع تحقيق كتاب القول البسيط في أخبار تمنطيط (لمحمد بن بابا حيده)",
374
- searcher.btitle,
375
- "#{searcher.class} has an unexpected btitle: #{searcher.btitle}")
376
- puts ("\n")
377
- puts searcher.au.bytes.collect.inspect
378
- faraj = "Faraj, Faraj Maḥmūd"
379
- puts ("\n»")
380
- puts "»".bytes.collect.inspect
381
- puts faraj.bytes.collect.inspect
382
- assert_equal(
383
- "Faraj, Faraj Maḥmūd",
384
- searcher.au,
385
- "#{searcher.class} has an unexpected author: #{searcher.au}")
386
- assert_equal("(DT299.T88 F373 2007)", first_holding.call_number, "#{searcher.class} first holding has an unexpected call number: #{first_holding.call_number}")
387
- end
388
-
389
- # Record doesn't exist in BobCat dev
390
- # def test_holdings_diacritics3
362
+ # def test_holdings_diacritics1
391
363
  # searcher = Exlibris::Primo::Searcher.new(
392
364
  # @searcher_setup,
393
- # { :primo_id => @primo_test_diacritics3_doc_id })
365
+ # { :primo_id => @primo_test_diacritics1_doc_id })
394
366
  # assert_equal(
395
- # "Mul har ha-gaʻash : ḥoḳre toldot Yiśraʼel le-nokhaḥ ha-Shoʼah",
367
+ # "Rubāʻīyāt-i Bābā Ṭāhir",
396
368
  # searcher.btitle,
397
369
  # "#{searcher.class} has an unexpected btitle: #{searcher.btitle}")
398
370
  # assert_equal(
399
- # "Engel, David",
371
+ # "Bābā-Ṭāhir, 11th cent",
400
372
  # searcher.au,
401
373
  # "#{searcher.class} has an unexpected author: #{searcher.au}")
402
374
  # end
375
+
376
+ # # This test fails but I don't know why!
377
+ # def test_holdings_diacritics2
378
+ # searcher = Exlibris::Primo::Searcher.new(
379
+ # @searcher_setup,
380
+ # { :primo_id => @primo_test_diacritics2_doc_id })
381
+ # assert_equal(
382
+ # "أقليم توات خلال القرنين الثامن عشر والتاسع عشر الميلاديين : دراسة لأوضاع الأقليم السياسية والأجتماعية والأقتصادية والثقافية، مع تحقيق كتاب القول البسيط في أخبار تمنطيط (لمحمد بن بابا حيده)",
383
+ # searcher.btitle,
384
+ # "#{searcher.class} has an unexpected btitle: #{searcher.btitle}")
385
+ # puts ("\n")
386
+ # puts searcher.au.bytes.collect.inspect
387
+ # faraj = "Faraj, Faraj Maḥmūd"
388
+ # puts ("\n»")
389
+ # puts "»".bytes.collect.inspect
390
+ # puts faraj.bytes.collect.inspect
391
+ # assert_equal(
392
+ # "Faraj, Faraj Maḥmūd",
393
+ # searcher.au,
394
+ # "#{searcher.class} has an unexpected author: #{searcher.au}")
395
+ # assert_equal("(DT299.T88 F373 2007)", first_holding.call_number, "#{searcher.class} first holding has an unexpected call number: #{first_holding.call_number}")
396
+ # end
397
+ #
398
+ # def test_holdings_diacritics3
399
+ # searcher = Exlibris::Primo::Searcher.new(
400
+ # @searcher_setup,
401
+ # { :primo_id => @primo_test_diacritics3_doc_id })
402
+ # assert_equal(
403
+ # "Mul har ha-gaʻash : ḥoḳre toldot Yiśraʼel le-nokhaḥ ha-Shoʼah",
404
+ # searcher.btitle,
405
+ # "#{searcher.class} has an unexpected btitle: #{searcher.btitle}")
406
+ # assert_equal(
407
+ # "Engel, David",
408
+ # searcher.au,
409
+ # "#{searcher.class} has an unexpected author: #{searcher.au}")
410
+ # end
403
411
  end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
1
+ require 'test_helper'
2
2
  class PrimoServiceTest < ActiveSupport::TestCase
3
3
  fixtures :requests, :referents, :referent_values, :sfx_urls
4
4
  def setup
@@ -6,7 +6,7 @@ class PrimoServiceTest < ActiveSupport::TestCase
6
6
  type: PrimoService
7
7
  priority: 2 # After SFX, to get SFX metadata enhancement
8
8
  status: active
9
- base_url: http://bobcatdev.library.nyu.edu
9
+ base_url: http://bobcat.library.nyu.edu
10
10
  vid: NYU
11
11
  institution: NYU
12
12
  holding_search_institution: NYU
@@ -24,13 +24,15 @@ class PrimoServiceTest < ActiveSupport::TestCase
24
24
 
25
25
  @base_url = @primo_definition["base_url"]
26
26
  @vid = @primo_definition["vid"]
27
+ @institution = @primo_definition["institution"]
27
28
 
28
29
  @primo_default = ServiceStore.instantiate_service!(
29
30
  YAML.load(%{
30
31
  type: PrimoService
32
+ service_id: NYUPrimo
31
33
  priority: 2 # After SFX, to get SFX metadata enhancement
32
34
  status: active
33
- base_url: http://bobcatdev.library.nyu.edu
35
+ base_url: http://bobcat.library.nyu.edu
34
36
  vid: NYU
35
37
  institution: NYU
36
38
  holding_search_institution: NYU
@@ -38,7 +40,7 @@ class PrimoServiceTest < ActiveSupport::TestCase
38
40
  suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
39
41
  ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/'
40
42
  service_types:
41
- - primo_source
43
+ - holding
42
44
  - holding_search
43
45
  - fulltext
44
46
  - table_of_contents
@@ -51,8 +53,9 @@ class PrimoServiceTest < ActiveSupport::TestCase
51
53
  type: PrimoService
52
54
  priority: 2 # After SFX, to get SFX metadata enhancement
53
55
  status: active
54
- base_url: http://bobcatdev.library.nyu.edu
56
+ base_url: http://bobcat.library.nyu.edu
55
57
  vid: NS
58
+ institution: NS
56
59
  holding_search_institution: NS
57
60
  holding_search_text: Search for this title in BobCat.
58
61
  suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
@@ -65,21 +68,21 @@ class PrimoServiceTest < ActiveSupport::TestCase
65
68
  - table_of_contents
66
69
  - referent_enhance
67
70
  - cover_image
68
- }), nil)
71
+ }), nil)
69
72
 
70
73
 
71
74
 
72
75
  @holding_search_institution =
73
76
  @primo_minimum = PrimoService.new({
74
- "priority"=>1, "service_id" => "NYU_Primo",
75
- "base_url" => @base_url, "vid" => @vid,
77
+ "priority"=>1, "service_id" => "Primo",
78
+ "base_url" => @base_url, "vid" => @vid, "institution" => @institution,
76
79
  "holding_search_institution" => @primo_definition["holding_search_institution"] })
77
80
  @primo_old_minimum = PrimoService.new({
78
- "priority"=>1, "service_id" => "NYU_Primo",
79
- "base_path" => @base_url, "base_view_id" => @vid })
81
+ "priority"=>1, "service_id" => "Primo",
82
+ "base_path" => @base_url, "base_view_id" => @vid, "institution" => @institution })
80
83
  @primo_minimum_no_config = PrimoService.new({
81
- "priority"=>1, "service_id" => "NYU_Primo",
82
- "base_url" => @base_url, "vid" => @vid,
84
+ "priority"=>1, "service_id" => "Primo",
85
+ "base_url" => @base_url, "vid" => @vid, "institution" => @institution,
83
86
  "holding_search_institution" => @primo_definition["holding_search_institution"],
84
87
  "primo_config" => "missing_config.yml" })
85
88
  end
@@ -99,58 +102,58 @@ class PrimoServiceTest < ActiveSupport::TestCase
99
102
  }
100
103
  end
101
104
  end
102
-
103
- def test_to_primo_source_benchmarks
104
- request = requests(:primo_id_request)
105
- @primo_default.handle(request)
106
- service_type = request.get_service_type('primo_source', {}).first
107
- Benchmark.bmbm do |results|
108
- results.report("PrimoService :to_primo_source via view data - NYUAleph:") {
109
- (1..10).each {
110
- service_type.view_data
111
- }
112
- }
113
- service_response = service_type.service_response
114
- results.report("PrimoService :to_primo_source - NYUAleph:") {
115
- (1..10).each {
116
- @primo_default.to_primo_source(service_response)
117
- }
118
- }
119
- end
120
- end
121
-
122
- def test_primo_source_benchmarks
123
- request = requests(:primo_id_request)
124
- @primo_default.handle(request)
125
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
126
- Benchmark.bmbm do |results|
127
- results.report("PrimoSource - NYUAleph:") {
128
- (1..10).each {
129
- primo_source.handle(request)
130
- }
131
- }
132
- end
133
- end
134
-
135
- def test_source_expand_benchmarks
136
- request = requests(:primo_id_request)
137
- @primo_default.handle(request)
138
- primo_source = request.get_service_type('primo_source', {}).first.view_data
139
- Benchmark.bmbm do |results|
140
- results.report("PrimoSource :expand - NYUAleph:") {
141
- (1..10).each {
142
- primo_source.expand
143
- }
144
- }
145
- end
146
- end
105
+ #
106
+ # def test_to_primo_source_benchmarks
107
+ # request = requests(:primo_id_request)
108
+ # @primo_default.handle(request)
109
+ # service_type = request.get_service_type('primo_source', {}).first
110
+ # Benchmark.bmbm do |results|
111
+ # results.report("PrimoService :to_primo_source via view data - NYUAleph:") {
112
+ # (1..10).each {
113
+ # service_type.view_data
114
+ # }
115
+ # }
116
+ # service_response = service_type.service_response
117
+ # results.report("PrimoService :to_primo_source - NYUAleph:") {
118
+ # (1..10).each {
119
+ # @primo_default.to_primo_source(service_response)
120
+ # }
121
+ # }
122
+ # end
123
+ # end
124
+ #
125
+ # def test_primo_source_benchmarks
126
+ # request = requests(:primo_id_request)
127
+ # @primo_default.handle(request)
128
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
129
+ # Benchmark.bmbm do |results|
130
+ # results.report("PrimoSource - NYUAleph:") {
131
+ # (1..10).each {
132
+ # primo_source.handle(request)
133
+ # }
134
+ # }
135
+ # end
136
+ # end
137
+ #
138
+ # def test_source_expand_benchmarks
139
+ # request = requests(:primo_id_request)
140
+ # @primo_default.handle(request)
141
+ # primo_source = request.get_service_type('primo_source', {}).first.view_data
142
+ # Benchmark.bmbm do |results|
143
+ # results.report("PrimoSource :expand - NYUAleph:") {
144
+ # (1..10).each {
145
+ # primo_source.expand
146
+ # }
147
+ # }
148
+ # end
149
+ # end
147
150
 
148
151
  def test_primo_service_minimum
149
152
  request = requests(:primo_id_request)
150
153
  @primo_minimum.handle(request)
151
154
  request.referent.referent_values.reset
152
155
  request.dispatched_services.reset
153
- request.service_types.reset
156
+ request.service_responses.reset
154
157
  test_data = {
155
158
  "aulast" => "Greene",
156
159
  "aufirst" => "Graham,",
@@ -207,7 +210,7 @@ class PrimoServiceTest < ActiveSupport::TestCase
207
210
  @primo_minimum_no_config.handle(request)
208
211
  request.referent.referent_values.reset
209
212
  request.dispatched_services.reset
210
- request.service_types.reset
213
+ request.service_responses.reset
211
214
  test_data = {
212
215
  "aulast" => "Greene",
213
216
  "aufirst" => "Graham,",
@@ -264,7 +267,7 @@ class PrimoServiceTest < ActiveSupport::TestCase
264
267
  @primo_old_minimum.handle(request)
265
268
  request.referent.referent_values.reset
266
269
  request.dispatched_services.reset
267
- request.service_types.reset
270
+ request.service_responses.reset
268
271
  test_data = {
269
272
  "aulast" => "Greene",
270
273
  "aufirst" => "Graham,",
@@ -316,624 +319,624 @@ class PrimoServiceTest < ActiveSupport::TestCase
316
319
  }
317
320
  end
318
321
 
319
- def test_available_nyu_aleph
320
- # Available
321
- request = requests(:primo_id_request)
322
- @primo_default.handle(request)
323
- request.dispatched_services.reset
324
- request.service_types.reset
325
- primo_sources = request.get_service_type('primo_source')
326
- assert_equal(
327
- 1, primo_sources.length)
328
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
329
- primo_source.handle(request)
330
- request.dispatched_services.reset
331
- request.service_types.reset
332
- holdings = request.get_service_type('holding')
333
- assert_equal(
334
- 1, holdings.length)
335
- test_data = {
336
- :record_id => "nyu_aleph000062856",
337
- :source_id => "nyu_aleph",
338
- :original_source_id => "NYU01",
339
- :source_record_id => "000062856",
340
- :institution_code => "NYU",
341
- :institution => "NYU",
342
- :library_code => "BOBST",
343
- :library => "NYU Bobst",
344
- :status_code => "available",
345
- :status => "Available",
346
- :id_one => "Main Collection",
347
- :id_two => "(PR6013.R44 T7 2004)",
348
- :collection => "Main Collection",
349
- :call_number => "(PR6013.R44 T7 2004)",
350
- :origin => nil,
351
- :display_type => "book",
352
- :coverage => [],
353
- :notes => "",
354
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
355
- :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
356
- :match_reliability => ServiceResponse::MatchExact,
357
- :request_link_supports_ajax_call => true }
358
- test_data.each { |key, value|
359
- assert_equal(
360
- value,
361
- holdings.first.view_data[key],
362
- "#{key} different than expected.")
363
- }
364
- source_data = {
365
- :aleph_doc_library => "NYU01",
366
- :aleph_sub_library => "NYU Bobst",
367
- :aleph_sub_library_code => "BOBST",
368
- :aleph_collection => "Main Collection",
369
- :aleph_call_number => "(PR6013.R44 T7 2004)",
370
- :aleph_doc_number => "000062856",
371
- :aleph_url => "http://alephstage.library.nyu.edu",
372
- :illiad_url => "http://illiaddev.library.nyu.edu",
373
- :aleph_sub_library_code => "BOBST",
374
- :aleph_item_id => "NYU50000062856000010",
375
- :aleph_item_adm_library => "NYU50",
376
- :aleph_item_sub_library_code => "BOBST",
377
- :aleph_item_collection_code => "MAIN",
378
- :aleph_item_doc_number => "000062856",
379
- :aleph_item_sequence_number => "1.0",
380
- :aleph_item_barcode => "31142041146104",
381
- :aleph_item_status_code => "01",
382
- :aleph_item_process_status_code => nil,
383
- :aleph_item_circulation_status => "On Shelf",
384
- :aleph_item_location => "PR6013.R44&nbsp;T7 2004",
385
- :aleph_item_description => nil,
386
- :aleph_item_hol_doc_number => "002992203"
387
- }
388
- source_data.each { |key, value|
389
- assert_equal(
390
- value,
391
- holdings.first.view_data[:source_data][key],
392
- "#{key} different than expected.")
393
- }
394
- end
395
-
396
- def test_available_tns_aleph
397
- # Available
398
- request = requests(:primo_id_request)
399
- @primo_tns.handle(request)
400
- request.dispatched_services.reset
401
- request.service_types.reset
402
- primo_sources = request.get_service_type('primo_source')
403
- assert_equal(
404
- 1, primo_sources.length)
405
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
406
- primo_source.handle(request)
407
- request.dispatched_services.reset
408
- request.service_types.reset
409
- holdings = request.get_service_type('holding')
410
- assert_equal(
411
- 1, holdings.length)
412
- test_data = {
413
- :record_id => "nyu_aleph000062856",
414
- :source_id => "nyu_aleph",
415
- :original_source_id => "NYU01",
416
- :source_record_id => "000062856",
417
- :institution_code => "NYU",
418
- :institution => "NYU",
419
- :library_code => "BOBST",
420
- :library => "NYU Bobst",
421
- :status_code => "available",
422
- :status => "Available",
423
- :id_one => "Main Collection",
424
- :id_two => "(PR6013.R44 T7 2004)",
425
- :collection => "Main Collection",
426
- :call_number => "(PR6013.R44 T7 2004)",
427
- :origin => nil,
428
- :display_type => "book",
429
- :coverage => [],
430
- :notes => "",
431
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
432
- :request_url => nil,
433
- :match_reliability => ServiceResponse::MatchExact,
434
- :request_link_supports_ajax_call => true }
435
- test_data.each { |key, value|
436
- assert_equal(
437
- value,
438
- holdings.first.view_data[key],
439
- "#{key} different than expected.")
440
- }
441
- source_data = {
442
- :aleph_doc_library => "NYU01",
443
- :aleph_sub_library => "NYU Bobst",
444
- :aleph_sub_library_code => "BOBST",
445
- :aleph_collection => "Main Collection",
446
- :aleph_call_number => "(PR6013.R44 T7 2004)",
447
- :aleph_doc_number => "000062856",
448
- :aleph_url => "http://alephstage.library.nyu.edu",
449
- :illiad_url => "http://illiaddev.library.nyu.edu",
450
- :aleph_sub_library_code => "BOBST",
451
- :aleph_item_id => "NYU50000062856000010",
452
- :aleph_item_adm_library => "NYU50",
453
- :aleph_item_sub_library_code => "BOBST",
454
- :aleph_item_collection_code => "MAIN",
455
- :aleph_item_doc_number => "000062856",
456
- :aleph_item_sequence_number => "1.0",
457
- :aleph_item_barcode => "31142041146104",
458
- :aleph_item_status_code => "01",
459
- :aleph_item_process_status_code => nil,
460
- :aleph_item_circulation_status => "On Shelf",
461
- :aleph_item_location => "PR6013.R44&nbsp;T7 2004",
462
- :aleph_item_description => nil,
463
- :aleph_item_hol_doc_number => "002992203"
464
- }
465
- source_data.each { |key, value|
466
- assert_equal(
467
- value,
468
- holdings.first.view_data[:source_data][key],
469
- "#{key} different than expected.")
470
- }
471
- end
472
-
473
- def test_checked_out_nyu_aleph
474
- request = requests(:primo_checked_out_request)
475
- @primo_default.handle(request)
476
- request.referent.referent_values.reset
477
- request.dispatched_services.reset
478
- request.service_types.reset
479
- primo_sources = request.get_service_type('primo_source')
480
- assert_equal(
481
- 1, primo_sources.length)
482
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
483
- primo_source.handle(request)
484
- request.dispatched_services.reset
485
- request.service_types.reset
486
- holdings = request.get_service_type('holding')
487
- assert_equal(
488
- 1, holdings.length)
489
- test_data = {
490
- :record_id => "nyu_aleph000742457",
491
- :source_id => "nyu_aleph",
492
- :original_source_id => "NYU01",
493
- :source_record_id => "000742457",
494
- :institution_code => "NYU",
495
- :institution => "NYU",
496
- :library_code => "BOBST",
497
- :library => "NYU Bobst",
498
- :status_code => "checked_out",
499
- :status => "Due: 08/25/11",
500
- :id_one => "Main Collection",
501
- :id_two => "(DR557 .J86 2001)",
502
- :collection => "Main Collection",
503
- :call_number => "(DR557 .J86 2001)",
504
- :origin => nil,
505
- :display_type => "book",
506
- :coverage => [],
507
- :notes => "",
508
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000742457&sub_library=BOBST",
509
- :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000742457&sub_library=BOBST",
510
- :match_reliability => ServiceResponse::MatchExact,
511
- :request_link_supports_ajax_call => true }
512
- test_data.each { |key, value|
513
- assert_equal(
514
- value,
515
- holdings.first.view_data[key],
516
- "#{key} different than expected.")
517
- }
518
- source_data = {
519
- :aleph_doc_library => "NYU01",
520
- :aleph_sub_library => "NYU Bobst",
521
- :aleph_sub_library_code => "BOBST",
522
- :aleph_collection => "Main Collection",
523
- :aleph_call_number => "(DR557 .J86 2001)",
524
- :aleph_doc_number => "000742457",
525
- :aleph_url => "http://alephstage.library.nyu.edu",
526
- :illiad_url => "http://illiaddev.library.nyu.edu",
527
- :aleph_sub_library_code => "BOBST",
528
- :aleph_item_id => "NYU50000742457000010",
529
- :aleph_item_adm_library => "NYU50",
530
- :aleph_item_sub_library_code => "BOBST",
531
- :aleph_item_collection_code => "MAIN",
532
- :aleph_item_doc_number => "000742457",
533
- :aleph_item_sequence_number => "1.0",
534
- :aleph_item_barcode => "31142031951646",
535
- :aleph_item_status_code => "01",
536
- :aleph_item_process_status_code => nil,
537
- :aleph_item_circulation_status => "08/25/11",
538
- :aleph_item_location => "DR557&nbsp;.J86 2001",
539
- :aleph_item_description => nil,
540
- :aleph_item_hol_doc_number => "002815266"
541
- }
542
- source_data.each { |key, value|
543
- assert_equal(
544
- value,
545
- holdings.first.view_data[:source_data][key],
546
- "#{key} different than expected.")
547
- }
548
- end
549
-
550
- def test_in_process_nyu_aleph
551
- request = requests(:primo_bobst_in_processing_request)
552
- @primo_default.handle(request)
553
- request.referent.referent_values.reset
554
- request.dispatched_services.reset
555
- request.service_types.reset
556
- primo_sources = request.get_service_type('primo_source')
557
- assert_equal(
558
- 1, primo_sources.length)
559
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
560
- primo_source.handle(request)
561
- request.dispatched_services.reset
562
- request.service_types.reset
563
- holdings = request.get_service_type('holding')
564
- assert_equal(
565
- 1, holdings.length)
566
- test_data = {
567
- :record_id => "nyu_aleph002723601",
568
- :source_id => "nyu_aleph",
569
- :original_source_id => "NYU01",
570
- :source_record_id => "002723601",
571
- :institution_code => "NYU",
572
- :institution => "NYU",
573
- :library_code => "BOBST",
574
- :library => "NYU Bobst",
575
- :status_code => "overridden_by_nyu_aleph",
576
- :status => "In Processing",
577
- :id_one => "Main Collection",
578
- :id_two => "(PN691 .B78 1983)",
579
- :collection => "Main Collection",
580
- :call_number => "(PN691 .B78 1983)",
581
- :origin => nil,
582
- :display_type => "book",
583
- :coverage => [],
584
- :notes => "",
585
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002723601&sub_library=BOBST",
586
- :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002723601&sub_library=BOBST",
587
- :match_reliability => ServiceResponse::MatchExact,
588
- :request_link_supports_ajax_call => true }
589
- test_data.each { |key, value|
590
- assert_equal(
591
- value,
592
- holdings.first.view_data[key],
593
- "#{key} different than expected.")
594
- }
595
- source_data = {
596
- :aleph_doc_library => "NYU01",
597
- :aleph_sub_library => "NYU Bobst",
598
- :aleph_sub_library_code => "BOBST",
599
- :aleph_collection => "Main Collection",
600
- :aleph_call_number => "(PN691 .B78 1983)",
601
- :aleph_doc_number => "002723601",
602
- :aleph_url => "http://alephstage.library.nyu.edu",
603
- :illiad_url => "http://illiaddev.library.nyu.edu",
604
- :aleph_sub_library_code => "BOBST",
605
- :aleph_item_id => "NYU50002723601000010",
606
- :aleph_item_adm_library => "NYU50",
607
- :aleph_item_sub_library_code => "BOBST",
608
- :aleph_item_collection_code => "MAIN",
609
- :aleph_item_doc_number => "002723601",
610
- :aleph_item_sequence_number => "1.0",
611
- :aleph_item_barcode => "31142011075952",
612
- :aleph_item_status_code => "01",
613
- :aleph_item_process_status_code => "BD",
614
- :aleph_item_circulation_status => "At Bindery",
615
- :aleph_item_location => "PN691&nbsp;.B78 1983",
616
- :aleph_item_description => nil,
617
- :aleph_item_hol_doc_number => "000631538"
618
- }
619
- source_data.each { |key, value|
620
- assert_equal(
621
- value,
622
- holdings.first.view_data[:source_data][key],
623
- "#{key} different than expected.")
624
- }
625
- end
626
-
627
- def test_journal1_nyu_aleph
628
- request = requests(:primo_journal1_request)
629
- @primo_default.handle(request)
630
- request.referent.referent_values.reset
631
- request.dispatched_services.reset
632
- request.service_types.reset
633
- primo_sources = request.get_service_type('primo_source')
634
- assert_equal(
635
- 4, primo_sources.length)
636
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
637
- primo_source.handle(request)
638
- request.dispatched_services.reset
639
- request.service_types.reset
640
- holdings = request.get_service_type('holding')
641
- assert_equal(
642
- 4, holdings.length)
643
- test_data = {
644
- :record_id => "nyu_aleph002895625",
645
- :source_id => "nyu_aleph",
646
- :original_source_id => "NYU01",
647
- :source_record_id => "002895625",
648
- :institution_code => "NYU",
649
- :institution => "NYU",
650
- :library_code => "BOBST",
651
- :library => "NYU Bobst",
652
- :status_code => "check_holdings",
653
- :status => "Check Availability",
654
- :id_one => "Main Collection",
655
- :id_two => "(ML1 .M819 )",
656
- :collection => "Main Collection",
657
- :call_number => "(ML1 .M819 )",
658
- :origin => nil,
659
- :display_type => "journal",
660
- :coverage => ["Available in Main Collection: VOLUMES: 1-89 (YEARS: 1915-2006)"],
661
- :notes => "",
662
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002895625&sub_library=BOBST",
663
- :request_url => nil,
664
- :match_reliability => ServiceResponse::MatchExact,
665
- :request_link_supports_ajax_call => false }
666
- test_data.each { |key, value|
667
- assert_equal(
668
- value,
669
- holdings.first.view_data[key],
670
- "#{key} different than expected.")
671
- }
672
- source_data = {
673
- :aleph_doc_library => "NYU01",
674
- :aleph_sub_library => "NYU Bobst",
675
- :aleph_sub_library_code => "BOBST",
676
- :aleph_collection => "Main Collection",
677
- :aleph_call_number => "(ML1 .M819 )",
678
- :aleph_doc_number => "002895625",
679
- :aleph_sub_library_code => "BOBST"
680
- }
681
- source_data.each { |key, value|
682
- assert_equal(
683
- value,
684
- holdings.first.view_data[:source_data][key],
685
- "#{key} different than expected.")
686
- }
687
- end
688
-
689
- def test_journal1_tns_aleph
690
- request = requests(:primo_journal1_request)
691
- @primo_tns.handle(request)
692
- request.referent.referent_values.reset
693
- request.dispatched_services.reset
694
- request.service_types.reset
695
- primo_sources = request.get_service_type('primo_source')
696
- assert_equal(
697
- 4, primo_sources.length)
698
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
699
- primo_source.handle(request)
700
- request.dispatched_services.reset
701
- request.service_types.reset
702
- holdings = request.get_service_type('holding')
703
- assert_equal(
704
- 4, holdings.length)
705
- test_data = {
706
- :record_id => "nyu_aleph002895625",
707
- :source_id => "nyu_aleph",
708
- :original_source_id => "NYU01",
709
- :source_record_id => "002895625",
710
- :institution_code => "NYU",
711
- :institution => "NYU",
712
- :library_code => "BOBST",
713
- :library => "NYU Bobst",
714
- :status_code => "check_holdings",
715
- :status => "Check Availability",
716
- :id_one => "Main Collection",
717
- :id_two => "(ML1 .M819 )",
718
- :collection => "Main Collection",
719
- :call_number => "(ML1 .M819 )",
720
- :origin => nil,
721
- :display_type => "journal",
722
- :coverage => ["Available in Main Collection: VOLUMES: 1-89 (YEARS: 1915-2006)"],
723
- :notes => "",
724
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002895625&sub_library=BOBST",
725
- :request_url => nil,
726
- :match_reliability => ServiceResponse::MatchExact,
727
- :request_link_supports_ajax_call => false }
728
- test_data.each { |key, value|
729
- assert_equal(
730
- value,
731
- holdings.first.view_data[key],
732
- "#{key} different than expected.")
733
- }
734
- source_data = {
735
- :aleph_doc_library => "NYU01",
736
- :aleph_sub_library => "NYU Bobst",
737
- :aleph_sub_library_code => "BOBST",
738
- :aleph_collection => "Main Collection",
739
- :aleph_call_number => "(ML1 .M819 )",
740
- :aleph_doc_number => "002895625",
741
- :aleph_sub_library_code => "BOBST"
742
- }
743
- source_data.each { |key, value|
744
- assert_equal(
745
- value,
746
- holdings.first.view_data[:source_data][key],
747
- "#{key} different than expected.")
748
- }
749
- end
750
-
751
- def test_journal2_nyu_aleph
752
- # Journal 2
753
- request = requests(:primo_journal2_request)
754
- @primo_default.handle(request)
755
- request.referent.referent_values.reset
756
- request.dispatched_services.reset
757
- request.service_types.reset
758
- # record_id = request.referent.metadata["primo"]
759
- assert_equal("Macomb", request.referent.metadata["place"]);
760
- assert_equal("Center for Business and Economic Research, Western Illinois University]", request.referent.metadata["pub"]);
761
- primo_sources = request.get_service_type('primo_source')
762
- assert(1 <= primo_sources.length)
763
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
764
- primo_source.handle(request)
765
- request.dispatched_services.reset
766
- request.service_types.reset
767
- holdings = request.get_service_type('holding')
768
- assert(1 <= holdings.length)
769
- assert_equal(primo_sources.length, holdings.length)
770
- assert_equal("NYU", holdings.first.view_data[:institution])
771
- assert_equal("NYU Bobst", holdings.first.view_data[:library])
772
- assert_equal("Main Collection", holdings.first.view_data[:id_one])
773
- assert_equal("http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002736245&sub_library=BOBST", holdings.first.view_data[:url])
774
- assert_equal("(HB1 .J55 )", holdings.first.view_data[:id_two])
775
- assert_equal("Check Availability", holdings.first.view_data[:status])
776
- end
777
-
778
- def test_journal3_nyu_aleph
779
- # Journal 3
780
- request = requests(:primo_journal3_request)
781
- @primo_default.handle(request)
782
- request.referent.referent_values.reset
783
- request.dispatched_services.reset
784
- request.service_types.reset
785
- # record_id = request.referent.metadata["primo"]
786
- assert_equal("Sydney", request.referent.metadata["place"]);
787
- assert_equal("Association for the Journal of Religious History]", request.referent.metadata["pub"]);
788
- primo_sources = request.get_service_type('primo_source')
789
- assert_equal(0, primo_sources.length)
790
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
791
- primo_source.handle(request)
792
- request.dispatched_services.reset
793
- request.service_types.reset
794
- holdings = request.get_service_type('holding')
795
- assert_equal(0, holdings.length)
796
- assert_equal(primo_sources.length, holdings.length)
797
- end
798
-
799
- def test_journal4_nyu_aleph
800
- # Journal 4
801
- request = requests(:primo_journal4_request)
802
- @primo_default.handle(request)
803
- request.referent.referent_values.reset
804
- request.dispatched_services.reset
805
- request.service_types.reset
806
- # record_id = request.referent.metadata["primo"]
807
- assert_equal("Waltham, MA", request.referent.metadata["place"]);
808
- assert_equal("Published for the Board by the Massachusetts Medical Society", request.referent.metadata["pub"]);
809
- primo_sources = request.get_service_type('primo_source')
810
- assert_equal(0, primo_sources.length)
811
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
812
- primo_source.handle(request)
813
- request.dispatched_services.reset
814
- request.service_types.reset
815
- holdings = request.get_service_type('holding')
816
- assert_equal(0, holdings.length)
817
- assert_equal(primo_sources.length, holdings.length)
818
- end
819
-
820
- def test_journal5_nyu_aleph
821
- request = requests(:primo_journal5_request)
822
- @primo_default.handle(request)
823
- request.referent.referent_values.reset
824
- request.dispatched_services.reset
825
- request.service_types.reset
826
- # record_id = request.referent.metadata["primo"]
827
- primo_sources = request.get_service_type('primo_source')
828
- assert_equal(1, primo_sources.length)
829
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
830
- primo_source.handle(request)
831
- request.dispatched_services.reset
832
- request.service_types.reset
833
- holdings = request.get_service_type('holding')
834
- assert_equal(1, holdings.length)
835
- assert_equal(primo_sources.length, holdings.length)
836
- end
837
-
838
- def test_bobst_genre_discrepancy
839
- request = requests(:primo_bobst_problem1_request)
840
- @primo_default.handle(request)
841
- request.dispatched_services.reset
842
- request.service_types.reset
843
- primo_sources = request.get_service_type('primo_source')
844
- assert_equal(
845
- 1, primo_sources.length)
846
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
847
- primo_source.handle(request)
848
- request.dispatched_services.reset
849
- request.service_types.reset
850
- holdings = request.get_service_type('holding')
851
- assert_equal(
852
- 1, holdings.length)
853
- test_data = {
854
- :record_id => "nyu_aleph000509288",
855
- :source_id => "nyu_aleph",
856
- :original_source_id => "NYU01",
857
- :source_record_id => "000509288",
858
- :institution_code => "NYU",
859
- :institution => "NYU",
860
- :library_code => "BOBST",
861
- :library => "NYU Bobst",
862
- :status_code => "available",
863
- :status => "Available",
864
- :id_one => "Main Collection",
865
- :id_two => "(ML410.J33 M47 2005a)",
866
- :collection => "Main Collection",
867
- :call_number => "(ML410.J33 M47 2005a)",
868
- :origin => nil,
869
- :display_type => "book",
870
- :coverage => [],
871
- :notes => "",
872
- :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000509288&sub_library=BOBST",
873
- :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000509288&sub_library=BOBST",
874
- :match_reliability => ServiceResponse::MatchExact,
875
- :request_link_supports_ajax_call => true }
876
- test_data.each { |key, value|
877
- assert_equal(
878
- value,
879
- holdings.first.view_data[key],
880
- "#{key} different than expected.")
881
- }
882
- source_data = {
883
- :aleph_doc_library => "NYU01",
884
- :aleph_sub_library => "NYU Bobst",
885
- :aleph_sub_library_code => "BOBST",
886
- :aleph_collection => "Main Collection",
887
- :aleph_call_number => "(ML410.J33 M47 2005a)",
888
- :aleph_doc_number => "000509288",
889
- :aleph_url => "http://alephstage.library.nyu.edu",
890
- :illiad_url => "http://illiaddev.library.nyu.edu",
891
- :aleph_sub_library_code => "BOBST",
892
- :aleph_item_id => "NYU50000509288000010",
893
- :aleph_item_adm_library => "NYU50",
894
- :aleph_item_sub_library_code => "BOBST",
895
- :aleph_item_collection_code => "MAIN",
896
- :aleph_item_doc_number => "000509288",
897
- :aleph_item_sequence_number => "1.0",
898
- :aleph_item_barcode => "31142045676163",
899
- :aleph_item_status_code => "01",
900
- :aleph_item_process_status_code => nil,
901
- :aleph_item_circulation_status => "On Shelf",
902
- :aleph_item_location => "ML410.J33&nbsp;M47 2005a",
903
- :aleph_item_description => nil,
904
- :aleph_item_hol_doc_number => "003227224"
905
- }
906
- source_data.each { |key, value|
907
- assert_equal(
908
- value,
909
- holdings.first.view_data[:source_data][key],
910
- "#{key} different than expected.")
911
- }
912
- end
913
-
914
- def test_critical_inquiry_bug
915
- request = requests(:critical_inquiry_request)
916
- @primo_default.handle(request)
917
- request.dispatched_services.reset
918
- request.service_types.reset
919
- primo_sources = request.get_service_type('primo_source')
920
- assert_equal(
921
- 4, primo_sources.length)
922
- primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
923
- primo_source.handle(request)
924
- request.dispatched_services.reset
925
- request.service_types.reset
926
- holdings = request.get_service_type('holding')
927
- assert_equal(
928
- 4, holdings.length)
929
- end
930
-
931
- def test_sfx_owner_but_fulltext_empty
932
- request = requests(:sfx_owner_but_fulltext_empty_request)
933
- @primo_default.handle(request)
934
- request.dispatched_services.reset
935
- request.service_types.reset
936
- fulltext = request.get_service_type('fulltext')
937
- assert_equal(0, fulltext.length)
938
- end
322
+ # def test_available_nyu_aleph
323
+ # # Available
324
+ # request = requests(:primo_id_request)
325
+ # @primo_default.handle(request)
326
+ # request.dispatched_services.reset
327
+ # request.service_types.reset
328
+ # primo_sources = request.get_service_type('primo_source')
329
+ # assert_equal(
330
+ # 1, primo_sources.length)
331
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
332
+ # primo_source.handle(request)
333
+ # request.dispatched_services.reset
334
+ # request.service_types.reset
335
+ # holdings = request.get_service_type('holding')
336
+ # assert_equal(
337
+ # 1, holdings.length)
338
+ # test_data = {
339
+ # :record_id => "nyu_aleph000062856",
340
+ # :source_id => "nyu_aleph",
341
+ # :original_source_id => "NYU01",
342
+ # :source_record_id => "000062856",
343
+ # :institution_code => "NYU",
344
+ # :institution => "NYU",
345
+ # :library_code => "BOBST",
346
+ # :library => "NYU Bobst",
347
+ # :status_code => "available",
348
+ # :status => "Available",
349
+ # :id_one => "Main Collection",
350
+ # :id_two => "(PR6013.R44 T7 2004)",
351
+ # :collection => "Main Collection",
352
+ # :call_number => "(PR6013.R44 T7 2004)",
353
+ # :origin => nil,
354
+ # :display_type => "book",
355
+ # :coverage => [],
356
+ # :notes => "",
357
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
358
+ # :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
359
+ # :match_reliability => ServiceResponse::MatchExact,
360
+ # :request_link_supports_ajax_call => true }
361
+ # test_data.each { |key, value|
362
+ # assert_equal(
363
+ # value,
364
+ # holdings.first.view_data[key],
365
+ # "#{key} different than expected.")
366
+ # }
367
+ # source_data = {
368
+ # :aleph_doc_library => "NYU01",
369
+ # :aleph_sub_library => "NYU Bobst",
370
+ # :aleph_sub_library_code => "BOBST",
371
+ # :aleph_collection => "Main Collection",
372
+ # :aleph_call_number => "(PR6013.R44 T7 2004)",
373
+ # :aleph_doc_number => "000062856",
374
+ # :aleph_url => "http://alephstage.library.nyu.edu",
375
+ # :illiad_url => "http://illiaddev.library.nyu.edu",
376
+ # :aleph_sub_library_code => "BOBST",
377
+ # :aleph_item_id => "NYU50000062856000010",
378
+ # :aleph_item_adm_library => "NYU50",
379
+ # :aleph_item_sub_library_code => "BOBST",
380
+ # :aleph_item_collection_code => "MAIN",
381
+ # :aleph_item_doc_number => "000062856",
382
+ # :aleph_item_sequence_number => "1.0",
383
+ # :aleph_item_barcode => "31142041146104",
384
+ # :aleph_item_status_code => "01",
385
+ # :aleph_item_process_status_code => nil,
386
+ # :aleph_item_circulation_status => "On Shelf",
387
+ # :aleph_item_location => "PR6013.R44&nbsp;T7 2004",
388
+ # :aleph_item_description => nil,
389
+ # :aleph_item_hol_doc_number => "002992203"
390
+ # }
391
+ # source_data.each { |key, value|
392
+ # assert_equal(
393
+ # value,
394
+ # holdings.first.view_data[:source_data][key],
395
+ # "#{key} different than expected.")
396
+ # }
397
+ # end
398
+ #
399
+ # def test_available_tns_aleph
400
+ # # Available
401
+ # request = requests(:primo_id_request)
402
+ # @primo_tns.handle(request)
403
+ # request.dispatched_services.reset
404
+ # request.service_types.reset
405
+ # primo_sources = request.get_service_type('primo_source')
406
+ # assert_equal(
407
+ # 1, primo_sources.length)
408
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
409
+ # primo_source.handle(request)
410
+ # request.dispatched_services.reset
411
+ # request.service_types.reset
412
+ # holdings = request.get_service_type('holding')
413
+ # assert_equal(
414
+ # 1, holdings.length)
415
+ # test_data = {
416
+ # :record_id => "nyu_aleph000062856",
417
+ # :source_id => "nyu_aleph",
418
+ # :original_source_id => "NYU01",
419
+ # :source_record_id => "000062856",
420
+ # :institution_code => "NYU",
421
+ # :institution => "NYU",
422
+ # :library_code => "BOBST",
423
+ # :library => "NYU Bobst",
424
+ # :status_code => "available",
425
+ # :status => "Available",
426
+ # :id_one => "Main Collection",
427
+ # :id_two => "(PR6013.R44 T7 2004)",
428
+ # :collection => "Main Collection",
429
+ # :call_number => "(PR6013.R44 T7 2004)",
430
+ # :origin => nil,
431
+ # :display_type => "book",
432
+ # :coverage => [],
433
+ # :notes => "",
434
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
435
+ # :request_url => nil,
436
+ # :match_reliability => ServiceResponse::MatchExact,
437
+ # :request_link_supports_ajax_call => true }
438
+ # test_data.each { |key, value|
439
+ # assert_equal(
440
+ # value,
441
+ # holdings.first.view_data[key],
442
+ # "#{key} different than expected.")
443
+ # }
444
+ # source_data = {
445
+ # :aleph_doc_library => "NYU01",
446
+ # :aleph_sub_library => "NYU Bobst",
447
+ # :aleph_sub_library_code => "BOBST",
448
+ # :aleph_collection => "Main Collection",
449
+ # :aleph_call_number => "(PR6013.R44 T7 2004)",
450
+ # :aleph_doc_number => "000062856",
451
+ # :aleph_url => "http://alephstage.library.nyu.edu",
452
+ # :illiad_url => "http://illiaddev.library.nyu.edu",
453
+ # :aleph_sub_library_code => "BOBST",
454
+ # :aleph_item_id => "NYU50000062856000010",
455
+ # :aleph_item_adm_library => "NYU50",
456
+ # :aleph_item_sub_library_code => "BOBST",
457
+ # :aleph_item_collection_code => "MAIN",
458
+ # :aleph_item_doc_number => "000062856",
459
+ # :aleph_item_sequence_number => "1.0",
460
+ # :aleph_item_barcode => "31142041146104",
461
+ # :aleph_item_status_code => "01",
462
+ # :aleph_item_process_status_code => nil,
463
+ # :aleph_item_circulation_status => "On Shelf",
464
+ # :aleph_item_location => "PR6013.R44&nbsp;T7 2004",
465
+ # :aleph_item_description => nil,
466
+ # :aleph_item_hol_doc_number => "002992203"
467
+ # }
468
+ # source_data.each { |key, value|
469
+ # assert_equal(
470
+ # value,
471
+ # holdings.first.view_data[:source_data][key],
472
+ # "#{key} different than expected.")
473
+ # }
474
+ # end
475
+ #
476
+ # def test_checked_out_nyu_aleph
477
+ # request = requests(:primo_checked_out_request)
478
+ # @primo_default.handle(request)
479
+ # request.referent.referent_values.reset
480
+ # request.dispatched_services.reset
481
+ # request.service_types.reset
482
+ # primo_sources = request.get_service_type('primo_source')
483
+ # assert_equal(
484
+ # 1, primo_sources.length)
485
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
486
+ # primo_source.handle(request)
487
+ # request.dispatched_services.reset
488
+ # request.service_types.reset
489
+ # holdings = request.get_service_type('holding')
490
+ # assert_equal(
491
+ # 1, holdings.length)
492
+ # test_data = {
493
+ # :record_id => "nyu_aleph000742457",
494
+ # :source_id => "nyu_aleph",
495
+ # :original_source_id => "NYU01",
496
+ # :source_record_id => "000742457",
497
+ # :institution_code => "NYU",
498
+ # :institution => "NYU",
499
+ # :library_code => "BOBST",
500
+ # :library => "NYU Bobst",
501
+ # :status_code => "checked_out",
502
+ # :status => "Due: 08/25/11",
503
+ # :id_one => "Main Collection",
504
+ # :id_two => "(DR557 .J86 2001)",
505
+ # :collection => "Main Collection",
506
+ # :call_number => "(DR557 .J86 2001)",
507
+ # :origin => nil,
508
+ # :display_type => "book",
509
+ # :coverage => [],
510
+ # :notes => "",
511
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000742457&sub_library=BOBST",
512
+ # :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000742457&sub_library=BOBST",
513
+ # :match_reliability => ServiceResponse::MatchExact,
514
+ # :request_link_supports_ajax_call => true }
515
+ # test_data.each { |key, value|
516
+ # assert_equal(
517
+ # value,
518
+ # holdings.first.view_data[key],
519
+ # "#{key} different than expected.")
520
+ # }
521
+ # source_data = {
522
+ # :aleph_doc_library => "NYU01",
523
+ # :aleph_sub_library => "NYU Bobst",
524
+ # :aleph_sub_library_code => "BOBST",
525
+ # :aleph_collection => "Main Collection",
526
+ # :aleph_call_number => "(DR557 .J86 2001)",
527
+ # :aleph_doc_number => "000742457",
528
+ # :aleph_url => "http://alephstage.library.nyu.edu",
529
+ # :illiad_url => "http://illiaddev.library.nyu.edu",
530
+ # :aleph_sub_library_code => "BOBST",
531
+ # :aleph_item_id => "NYU50000742457000010",
532
+ # :aleph_item_adm_library => "NYU50",
533
+ # :aleph_item_sub_library_code => "BOBST",
534
+ # :aleph_item_collection_code => "MAIN",
535
+ # :aleph_item_doc_number => "000742457",
536
+ # :aleph_item_sequence_number => "1.0",
537
+ # :aleph_item_barcode => "31142031951646",
538
+ # :aleph_item_status_code => "01",
539
+ # :aleph_item_process_status_code => nil,
540
+ # :aleph_item_circulation_status => "08/25/11",
541
+ # :aleph_item_location => "DR557&nbsp;.J86 2001",
542
+ # :aleph_item_description => nil,
543
+ # :aleph_item_hol_doc_number => "002815266"
544
+ # }
545
+ # source_data.each { |key, value|
546
+ # assert_equal(
547
+ # value,
548
+ # holdings.first.view_data[:source_data][key],
549
+ # "#{key} different than expected.")
550
+ # }
551
+ # end
552
+ #
553
+ # def test_in_process_nyu_aleph
554
+ # request = requests(:primo_bobst_in_processing_request)
555
+ # @primo_default.handle(request)
556
+ # request.referent.referent_values.reset
557
+ # request.dispatched_services.reset
558
+ # request.service_types.reset
559
+ # primo_sources = request.get_service_type('primo_source')
560
+ # assert_equal(
561
+ # 1, primo_sources.length)
562
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
563
+ # primo_source.handle(request)
564
+ # request.dispatched_services.reset
565
+ # request.service_types.reset
566
+ # holdings = request.get_service_type('holding')
567
+ # assert_equal(
568
+ # 1, holdings.length)
569
+ # test_data = {
570
+ # :record_id => "nyu_aleph002723601",
571
+ # :source_id => "nyu_aleph",
572
+ # :original_source_id => "NYU01",
573
+ # :source_record_id => "002723601",
574
+ # :institution_code => "NYU",
575
+ # :institution => "NYU",
576
+ # :library_code => "BOBST",
577
+ # :library => "NYU Bobst",
578
+ # :status_code => "overridden_by_nyu_aleph",
579
+ # :status => "In Processing",
580
+ # :id_one => "Main Collection",
581
+ # :id_two => "(PN691 .B78 1983)",
582
+ # :collection => "Main Collection",
583
+ # :call_number => "(PN691 .B78 1983)",
584
+ # :origin => nil,
585
+ # :display_type => "book",
586
+ # :coverage => [],
587
+ # :notes => "",
588
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002723601&sub_library=BOBST",
589
+ # :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002723601&sub_library=BOBST",
590
+ # :match_reliability => ServiceResponse::MatchExact,
591
+ # :request_link_supports_ajax_call => true }
592
+ # test_data.each { |key, value|
593
+ # assert_equal(
594
+ # value,
595
+ # holdings.first.view_data[key],
596
+ # "#{key} different than expected.")
597
+ # }
598
+ # source_data = {
599
+ # :aleph_doc_library => "NYU01",
600
+ # :aleph_sub_library => "NYU Bobst",
601
+ # :aleph_sub_library_code => "BOBST",
602
+ # :aleph_collection => "Main Collection",
603
+ # :aleph_call_number => "(PN691 .B78 1983)",
604
+ # :aleph_doc_number => "002723601",
605
+ # :aleph_url => "http://alephstage.library.nyu.edu",
606
+ # :illiad_url => "http://illiaddev.library.nyu.edu",
607
+ # :aleph_sub_library_code => "BOBST",
608
+ # :aleph_item_id => "NYU50002723601000010",
609
+ # :aleph_item_adm_library => "NYU50",
610
+ # :aleph_item_sub_library_code => "BOBST",
611
+ # :aleph_item_collection_code => "MAIN",
612
+ # :aleph_item_doc_number => "002723601",
613
+ # :aleph_item_sequence_number => "1.0",
614
+ # :aleph_item_barcode => "31142011075952",
615
+ # :aleph_item_status_code => "01",
616
+ # :aleph_item_process_status_code => "BD",
617
+ # :aleph_item_circulation_status => "At Bindery",
618
+ # :aleph_item_location => "PN691&nbsp;.B78 1983",
619
+ # :aleph_item_description => nil,
620
+ # :aleph_item_hol_doc_number => "000631538"
621
+ # }
622
+ # source_data.each { |key, value|
623
+ # assert_equal(
624
+ # value,
625
+ # holdings.first.view_data[:source_data][key],
626
+ # "#{key} different than expected.")
627
+ # }
628
+ # end
629
+ #
630
+ # def test_journal1_nyu_aleph
631
+ # request = requests(:primo_journal1_request)
632
+ # @primo_default.handle(request)
633
+ # request.referent.referent_values.reset
634
+ # request.dispatched_services.reset
635
+ # request.service_types.reset
636
+ # primo_sources = request.get_service_type('primo_source')
637
+ # assert_equal(
638
+ # 4, primo_sources.length)
639
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
640
+ # primo_source.handle(request)
641
+ # request.dispatched_services.reset
642
+ # request.service_types.reset
643
+ # holdings = request.get_service_type('holding')
644
+ # assert_equal(
645
+ # 4, holdings.length)
646
+ # test_data = {
647
+ # :record_id => "nyu_aleph002895625",
648
+ # :source_id => "nyu_aleph",
649
+ # :original_source_id => "NYU01",
650
+ # :source_record_id => "002895625",
651
+ # :institution_code => "NYU",
652
+ # :institution => "NYU",
653
+ # :library_code => "BOBST",
654
+ # :library => "NYU Bobst",
655
+ # :status_code => "check_holdings",
656
+ # :status => "Check Availability",
657
+ # :id_one => "Main Collection",
658
+ # :id_two => "(ML1 .M819 )",
659
+ # :collection => "Main Collection",
660
+ # :call_number => "(ML1 .M819 )",
661
+ # :origin => nil,
662
+ # :display_type => "journal",
663
+ # :coverage => ["Available in Main Collection: VOLUMES: 1-89 (YEARS: 1915-2006)"],
664
+ # :notes => "",
665
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002895625&sub_library=BOBST",
666
+ # :request_url => nil,
667
+ # :match_reliability => ServiceResponse::MatchExact,
668
+ # :request_link_supports_ajax_call => false }
669
+ # test_data.each { |key, value|
670
+ # assert_equal(
671
+ # value,
672
+ # holdings.first.view_data[key],
673
+ # "#{key} different than expected.")
674
+ # }
675
+ # source_data = {
676
+ # :aleph_doc_library => "NYU01",
677
+ # :aleph_sub_library => "NYU Bobst",
678
+ # :aleph_sub_library_code => "BOBST",
679
+ # :aleph_collection => "Main Collection",
680
+ # :aleph_call_number => "(ML1 .M819 )",
681
+ # :aleph_doc_number => "002895625",
682
+ # :aleph_sub_library_code => "BOBST"
683
+ # }
684
+ # source_data.each { |key, value|
685
+ # assert_equal(
686
+ # value,
687
+ # holdings.first.view_data[:source_data][key],
688
+ # "#{key} different than expected.")
689
+ # }
690
+ # end
691
+ #
692
+ # def test_journal1_tns_aleph
693
+ # request = requests(:primo_journal1_request)
694
+ # @primo_tns.handle(request)
695
+ # request.referent.referent_values.reset
696
+ # request.dispatched_services.reset
697
+ # request.service_types.reset
698
+ # primo_sources = request.get_service_type('primo_source')
699
+ # assert_equal(
700
+ # 4, primo_sources.length)
701
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
702
+ # primo_source.handle(request)
703
+ # request.dispatched_services.reset
704
+ # request.service_types.reset
705
+ # holdings = request.get_service_type('holding')
706
+ # assert_equal(
707
+ # 4, holdings.length)
708
+ # test_data = {
709
+ # :record_id => "nyu_aleph002895625",
710
+ # :source_id => "nyu_aleph",
711
+ # :original_source_id => "NYU01",
712
+ # :source_record_id => "002895625",
713
+ # :institution_code => "NYU",
714
+ # :institution => "NYU",
715
+ # :library_code => "BOBST",
716
+ # :library => "NYU Bobst",
717
+ # :status_code => "check_holdings",
718
+ # :status => "Check Availability",
719
+ # :id_one => "Main Collection",
720
+ # :id_two => "(ML1 .M819 )",
721
+ # :collection => "Main Collection",
722
+ # :call_number => "(ML1 .M819 )",
723
+ # :origin => nil,
724
+ # :display_type => "journal",
725
+ # :coverage => ["Available in Main Collection: VOLUMES: 1-89 (YEARS: 1915-2006)"],
726
+ # :notes => "",
727
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002895625&sub_library=BOBST",
728
+ # :request_url => nil,
729
+ # :match_reliability => ServiceResponse::MatchExact,
730
+ # :request_link_supports_ajax_call => false }
731
+ # test_data.each { |key, value|
732
+ # assert_equal(
733
+ # value,
734
+ # holdings.first.view_data[key],
735
+ # "#{key} different than expected.")
736
+ # }
737
+ # source_data = {
738
+ # :aleph_doc_library => "NYU01",
739
+ # :aleph_sub_library => "NYU Bobst",
740
+ # :aleph_sub_library_code => "BOBST",
741
+ # :aleph_collection => "Main Collection",
742
+ # :aleph_call_number => "(ML1 .M819 )",
743
+ # :aleph_doc_number => "002895625",
744
+ # :aleph_sub_library_code => "BOBST"
745
+ # }
746
+ # source_data.each { |key, value|
747
+ # assert_equal(
748
+ # value,
749
+ # holdings.first.view_data[:source_data][key],
750
+ # "#{key} different than expected.")
751
+ # }
752
+ # end
753
+ #
754
+ # def test_journal2_nyu_aleph
755
+ # # Journal 2
756
+ # request = requests(:primo_journal2_request)
757
+ # @primo_default.handle(request)
758
+ # request.referent.referent_values.reset
759
+ # request.dispatched_services.reset
760
+ # request.service_types.reset
761
+ # # record_id = request.referent.metadata["primo"]
762
+ # assert_equal("Macomb", request.referent.metadata["place"]);
763
+ # assert_equal("Center for Business and Economic Research, Western Illinois University]", request.referent.metadata["pub"]);
764
+ # primo_sources = request.get_service_type('primo_source')
765
+ # assert(1 <= primo_sources.length)
766
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
767
+ # primo_source.handle(request)
768
+ # request.dispatched_services.reset
769
+ # request.service_types.reset
770
+ # holdings = request.get_service_type('holding')
771
+ # assert(1 <= holdings.length)
772
+ # assert_equal(primo_sources.length, holdings.length)
773
+ # assert_equal("NYU", holdings.first.view_data[:institution])
774
+ # assert_equal("NYU Bobst", holdings.first.view_data[:library])
775
+ # assert_equal("Main Collection", holdings.first.view_data[:id_one])
776
+ # assert_equal("http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002736245&sub_library=BOBST", holdings.first.view_data[:url])
777
+ # assert_equal("(HB1 .J55 )", holdings.first.view_data[:id_two])
778
+ # assert_equal("Check Availability", holdings.first.view_data[:status])
779
+ # end
780
+ #
781
+ # def test_journal3_nyu_aleph
782
+ # # Journal 3
783
+ # request = requests(:primo_journal3_request)
784
+ # @primo_default.handle(request)
785
+ # request.referent.referent_values.reset
786
+ # request.dispatched_services.reset
787
+ # request.service_types.reset
788
+ # # record_id = request.referent.metadata["primo"]
789
+ # assert_equal("Sydney", request.referent.metadata["place"]);
790
+ # assert_equal("Association for the Journal of Religious History]", request.referent.metadata["pub"]);
791
+ # primo_sources = request.get_service_type('primo_source')
792
+ # assert_equal(0, primo_sources.length)
793
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
794
+ # primo_source.handle(request)
795
+ # request.dispatched_services.reset
796
+ # request.service_types.reset
797
+ # holdings = request.get_service_type('holding')
798
+ # assert_equal(0, holdings.length)
799
+ # assert_equal(primo_sources.length, holdings.length)
800
+ # end
801
+ #
802
+ # def test_journal4_nyu_aleph
803
+ # # Journal 4
804
+ # request = requests(:primo_journal4_request)
805
+ # @primo_default.handle(request)
806
+ # request.referent.referent_values.reset
807
+ # request.dispatched_services.reset
808
+ # request.service_types.reset
809
+ # # record_id = request.referent.metadata["primo"]
810
+ # assert_equal("Waltham, MA", request.referent.metadata["place"]);
811
+ # assert_equal("Published for the Board by the Massachusetts Medical Society", request.referent.metadata["pub"]);
812
+ # primo_sources = request.get_service_type('primo_source')
813
+ # assert_equal(0, primo_sources.length)
814
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
815
+ # primo_source.handle(request)
816
+ # request.dispatched_services.reset
817
+ # request.service_types.reset
818
+ # holdings = request.get_service_type('holding')
819
+ # assert_equal(0, holdings.length)
820
+ # assert_equal(primo_sources.length, holdings.length)
821
+ # end
822
+ #
823
+ # def test_journal5_nyu_aleph
824
+ # request = requests(:primo_journal5_request)
825
+ # @primo_default.handle(request)
826
+ # request.referent.referent_values.reset
827
+ # request.dispatched_services.reset
828
+ # request.service_types.reset
829
+ # # record_id = request.referent.metadata["primo"]
830
+ # primo_sources = request.get_service_type('primo_source')
831
+ # assert_equal(1, primo_sources.length)
832
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
833
+ # primo_source.handle(request)
834
+ # request.dispatched_services.reset
835
+ # request.service_types.reset
836
+ # holdings = request.get_service_type('holding')
837
+ # assert_equal(1, holdings.length)
838
+ # assert_equal(primo_sources.length, holdings.length)
839
+ # end
840
+ #
841
+ # def test_bobst_genre_discrepancy
842
+ # request = requests(:primo_bobst_problem1_request)
843
+ # @primo_default.handle(request)
844
+ # request.dispatched_services.reset
845
+ # request.service_types.reset
846
+ # primo_sources = request.get_service_type('primo_source')
847
+ # assert_equal(
848
+ # 1, primo_sources.length)
849
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
850
+ # primo_source.handle(request)
851
+ # request.dispatched_services.reset
852
+ # request.service_types.reset
853
+ # holdings = request.get_service_type('holding')
854
+ # assert_equal(
855
+ # 1, holdings.length)
856
+ # test_data = {
857
+ # :record_id => "nyu_aleph000509288",
858
+ # :source_id => "nyu_aleph",
859
+ # :original_source_id => "NYU01",
860
+ # :source_record_id => "000509288",
861
+ # :institution_code => "NYU",
862
+ # :institution => "NYU",
863
+ # :library_code => "BOBST",
864
+ # :library => "NYU Bobst",
865
+ # :status_code => "available",
866
+ # :status => "Available",
867
+ # :id_one => "Main Collection",
868
+ # :id_two => "(ML410.J33 M47 2005a)",
869
+ # :collection => "Main Collection",
870
+ # :call_number => "(ML410.J33 M47 2005a)",
871
+ # :origin => nil,
872
+ # :display_type => "book",
873
+ # :coverage => [],
874
+ # :notes => "",
875
+ # :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000509288&sub_library=BOBST",
876
+ # :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000509288&sub_library=BOBST",
877
+ # :match_reliability => ServiceResponse::MatchExact,
878
+ # :request_link_supports_ajax_call => true }
879
+ # test_data.each { |key, value|
880
+ # assert_equal(
881
+ # value,
882
+ # holdings.first.view_data[key],
883
+ # "#{key} different than expected.")
884
+ # }
885
+ # source_data = {
886
+ # :aleph_doc_library => "NYU01",
887
+ # :aleph_sub_library => "NYU Bobst",
888
+ # :aleph_sub_library_code => "BOBST",
889
+ # :aleph_collection => "Main Collection",
890
+ # :aleph_call_number => "(ML410.J33 M47 2005a)",
891
+ # :aleph_doc_number => "000509288",
892
+ # :aleph_url => "http://alephstage.library.nyu.edu",
893
+ # :illiad_url => "http://illiaddev.library.nyu.edu",
894
+ # :aleph_sub_library_code => "BOBST",
895
+ # :aleph_item_id => "NYU50000509288000010",
896
+ # :aleph_item_adm_library => "NYU50",
897
+ # :aleph_item_sub_library_code => "BOBST",
898
+ # :aleph_item_collection_code => "MAIN",
899
+ # :aleph_item_doc_number => "000509288",
900
+ # :aleph_item_sequence_number => "1.0",
901
+ # :aleph_item_barcode => "31142045676163",
902
+ # :aleph_item_status_code => "01",
903
+ # :aleph_item_process_status_code => nil,
904
+ # :aleph_item_circulation_status => "On Shelf",
905
+ # :aleph_item_location => "ML410.J33&nbsp;M47 2005a",
906
+ # :aleph_item_description => nil,
907
+ # :aleph_item_hol_doc_number => "003227224"
908
+ # }
909
+ # source_data.each { |key, value|
910
+ # assert_equal(
911
+ # value,
912
+ # holdings.first.view_data[:source_data][key],
913
+ # "#{key} different than expected.")
914
+ # }
915
+ # end
916
+ #
917
+ # def test_critical_inquiry_bug
918
+ # request = requests(:critical_inquiry_request)
919
+ # @primo_default.handle(request)
920
+ # request.dispatched_services.reset
921
+ # request.service_types.reset
922
+ # primo_sources = request.get_service_type('primo_source')
923
+ # assert_equal(
924
+ # 4, primo_sources.length)
925
+ # primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
926
+ # primo_source.handle(request)
927
+ # request.dispatched_services.reset
928
+ # request.service_types.reset
929
+ # holdings = request.get_service_type('holding')
930
+ # assert_equal(
931
+ # 4, holdings.length)
932
+ # end
933
+ #
934
+ # def test_sfx_owner_but_fulltext_empty
935
+ # request = requests(:sfx_owner_but_fulltext_empty_request)
936
+ # @primo_default.handle(request)
937
+ # request.dispatched_services.reset
938
+ # request.service_types.reset
939
+ # fulltext = request.get_service_type('fulltext')
940
+ # assert_equal(0, fulltext.length)
941
+ # end
939
942
  end