umlaut 3.0.0alpha9 → 3.0.0alpha10
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/umlaut_controller.rb +5 -0
- data/app/models/collection.rb +90 -54
- data/app/models/referent.rb +30 -17
- data/app/models/service_wave.rb +59 -41
- data/lib/exlibris/primo/holding.rb +3 -9
- data/lib/exlibris/primo/related_link.rb +17 -0
- data/lib/exlibris/primo/searcher.rb +52 -31
- data/lib/exlibris/primo/source/distribution/nyu_aleph.rb +59 -38
- data/lib/exlibris/primo_ws.rb +1 -1
- data/lib/service.rb +1 -1
- data/lib/service_adaptors/primo_service.rb +38 -5
- data/lib/service_adaptors/primo_source.rb +2 -2
- data/lib/service_adaptors/sfx.rb +11 -0
- data/lib/term_color.rb +9 -2
- data/lib/umlaut/version.rb +1 -1
- data/lib/umlaut_configurable.rb +9 -0
- data/test/dummy/config/umlaut_services.yml +20 -0
- data/test/dummy/tmp/cache/assets/CDC/680/sprockets%2F2b68ef632d12610f3c9563168bfa7c05 +0 -0
- data/test/dummy/tmp/cache/assets/CF5/9B0/sprockets%2F7933bfe880731b396791f1682ce3f7fa +0 -0
- data/test/dummy/tmp/cache/assets/CFB/2F0/sprockets%2F62d51f0aa5cac4b1cf7091823772a604 +0 -0
- data/test/dummy/tmp/cache/assets/D4C/0A0/sprockets%2F7810d837eec3ac57ad78756af83a6a55 +0 -0
- data/test/dummy/tmp/cache/assets/D4C/E30/sprockets%2F631abf89746799b7a5b2b3b4f6294bcd +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
- data/test/dummy/tmp/cache/assets/D70/080/sprockets%2F24d3ce40ae5cc827a9183b1fb837e84e +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
- data/test/unit/aleph_patron_test.rb +6 -6
- data/test/unit/aleph_record_benchmarks.rb +1 -1
- data/test/unit/aleph_record_test.rb +4 -4
- data/test/unit/primo_searcher_test.rb +90 -82
- data/test/unit/primo_service_test.rb +683 -680
- data/test/unit/primo_ws_test.rb +45 -32
- metadata +135 -155
- data/lib/tasks/#Untitled-1# +0 -1843
- 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://
|
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/
|
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
|
-
|
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
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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(
|
82
|
-
assert_equal(@primo_holdings_doc_id, search_results.at("//control/recordid").inner_text, "#{searcher.class} returned an unexpected record: #{search_results.
|
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(
|
92
|
-
assert_equal(@primo_test_problem_doc_id, search_results.at("//control/recordid").inner_text, "#{searcher.class} returned an unexpected record: #{search_results.
|
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(
|
102
|
-
assert_equal(@primo_test_bug1361_id, search_results.at("//control/recordid").inner_text, "#{searcher.class} returned an unexpected record: #{search_results.
|
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(
|
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.
|
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(
|
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(
|
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.
|
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(
|
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.
|
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 => "
|
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(
|
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 => @
|
365
|
+
# { :primo_id => @primo_test_diacritics1_doc_id })
|
394
366
|
# assert_equal(
|
395
|
-
# "
|
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
|
-
# "
|
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
|
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://
|
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://
|
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
|
-
-
|
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://
|
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" => "
|
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" => "
|
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" => "
|
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
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_primo_source_benchmarks
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
def test_source_expand_benchmarks
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
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.
|
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.
|
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.
|
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
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
end
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
end
|
472
|
-
|
473
|
-
def test_checked_out_nyu_aleph
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
end
|
549
|
-
|
550
|
-
def test_in_process_nyu_aleph
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
end
|
626
|
-
|
627
|
-
def test_journal1_nyu_aleph
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
end
|
688
|
-
|
689
|
-
def test_journal1_tns_aleph
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
end
|
750
|
-
|
751
|
-
def test_journal2_nyu_aleph
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
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 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 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 .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 .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 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
|