umlaut 3.0.0alpha10 → 3.0.0alpha11
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/collection.rb +7 -1
- data/app/models/referent.rb +11 -77
- data/app/models/request.rb +2 -2
- data/app/models/service_store.rb +4 -0
- data/app/models/service_wave.rb +1 -1
- data/lib/section_renderer.rb +9 -5
- data/lib/service.rb +0 -62
- data/lib/service_adaptors/isi.rb +1 -1
- data/lib/service_adaptors/jcr.rb +1 -1
- data/lib/umlaut/version.rb +1 -1
- data/lib/umlaut_configurable.rb +1 -0
- data/test/dummy/config/environments/profile.rb +24 -0
- data/test/dummy/config/primo.yml +271 -0
- data/test/dummy/config/umlaut_services-TEST.yml +37 -0
- data/test/dummy/profile/sfx_collection_prof.rb +22 -0
- data/test/dummy/tmp/cache/assets/C2A/410/sprockets%2Fd654b74912b4773a2534616863fb6565 +0 -0
- data/test/dummy/tmp/cache/assets/C45/A30/sprockets%2F39494895e462697b478d3d0c79298a26 +0 -0
- data/test/dummy/tmp/cache/assets/C5F/340/sprockets%2F99692920160b7a279b86a80415b79db7 +0 -0
- data/test/dummy/tmp/cache/assets/C70/4D0/sprockets%2F034ad2036e623081bd352800786dfe80 +0 -0
- data/test/dummy/tmp/cache/assets/C80/980/sprockets%2Fc94807409c1523d43e18d25f35d93c41 +0 -0
- data/test/dummy/tmp/cache/assets/{D0E/570/sprockets%2Fd4a16e3bdd7c7b9543c446b1b0174688 → CBD/730/sprockets%2F034c1086748b981c36672d5a56e7fed6} +0 -0
- data/test/dummy/tmp/cache/assets/CBF/B60/sprockets%2F08ca89671549936265dcb673bf02e36f +0 -0
- data/test/dummy/tmp/cache/assets/CC9/9F0/sprockets%2F306166316e2cafd13c15e62b51a2339d +0 -0
- data/test/dummy/tmp/cache/assets/CD6/300/sprockets%2F397ec39d3d883789effe506c38760368 +0 -0
- data/test/dummy/tmp/cache/assets/CD7/DD0/sprockets%2F4f1fe68aa2042a0970bde9b185530646 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/CF7/2B0/sprockets%2F25a7c73655bd3598173b39d9f98bcd46 +0 -0
- data/test/dummy/tmp/cache/assets/CFE/080/sprockets%2F37fe9f4255baddbd549a659914929398 +0 -0
- data/test/dummy/tmp/cache/assets/{CE1/F50/sprockets%2F6e6b593b107866863500ba0fee5a9e24 → D16/F90/sprockets%2F5fe3c021048c6f9a6086bed7736d87b1} +0 -0
- data/test/dummy/tmp/cache/assets/{CDD/7D0/sprockets%2F60687bff4553a7f8c701bb9627a6200a → D24/360/sprockets%2F6987b047a96dc685ba3cf39b31477f6d} +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D37/2B0/sprockets%2F40834fb07d7318c1fddd5003bd9e04f6 +0 -0
- data/test/dummy/tmp/cache/assets/D43/0D0/sprockets%2F682843a8d0795a5fbcfeb2f0c81727d0 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D50/A30/sprockets%2F7d8b294ac433db5d056538f8cf7c66b9 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
- data/test/dummy/tmp/cache/assets/D94/FF0/sprockets%2F3b56a1aa77de0d570c38a4a9d5f4b1d6 +0 -0
- data/test/dummy/tmp/cache/assets/D97/6B0/sprockets%2Fb070e8c799d1a4ad5e62e0a1ae3b83e6 +0 -0
- data/test/dummy/tmp/cache/assets/DA6/A80/sprockets%2F92e26d8e58d5bcc8b8f6c25d1b05b9c1 +0 -0
- data/test/dummy/tmp/cache/assets/{DB7/BD0/sprockets%2Ff2c59778ab79dcfd3792f46f2ce82f2a → DC0/D20/sprockets%2F1ccf7405cd252dcec4bf23af82e2563a} +0 -0
- data/test/dummy/tmp/cache/assets/{D5C/B00/sprockets%2F2b7ac06cc680d7480c06b917bac5a6b0 → DD2/D80/sprockets%2Fc66d103807d0f971fbbcf9aa8b8b27ee} +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/DE8/790/sprockets%2Fd1333bde2b9aafcc712d11dd09ab35d8 +0 -0
- data/test/dummy/tmp/cache/assets/DF5/5E0/sprockets%2F8e64a37c73cdc0b37a4ccfcb42ab45d8 +0 -0
- data/test/dummy/tmp/cache/assets/DF7/960/sprockets%2F99ac6db10b44a64fbba4ee847b35ba8b +0 -0
- data/test/dummy/tmp/cache/assets/{C84/A00/sprockets%2F3ba04c88513936081d59d8771f6804aa → DFC/040/sprockets%2F15ea81cf915c0cb1dfc9cc04c9fef364} +0 -0
- data/test/dummy/tmp/cache/assets/DFD/300/sprockets%2Fabac9489cf7f1db8ef00d72a1571ee1e +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E38/FE0/sprockets%2Fe1fc875efa817cbb94a5d8de25ea4e6b +0 -0
- data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_gc_runs.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_gc_time.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_memory.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_objects.csv +2 -0
- data/test/dummy/tmp/performance/BenchmarkerTest#test_puts_foo_wall_time.csv +2 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_flat.txt +11 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_graph.html +303 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_stack.html +546 -0
- data/test/dummy/tmp/performance/ProfilerTest#test_puts_foo_process_time_tree.txt +38 -0
- data/test/dummy/tmp/performance/empty.png +0 -0
- data/test/dummy/tmp/performance/minus.png +0 -0
- data/test/dummy/tmp/performance/plus.png +0 -0
- data/test/test_helper.rb +36 -0
- data/test/unit/aleph_patron_test.rb +40 -35
- data/test/unit/aleph_record_benchmarks.rb +28 -24
- data/test/unit/aleph_record_test.rb +31 -26
- data/test/unit/collection_test.rb +17 -18
- data/test/unit/google_book_search_test.rb +18 -44
- data/test/unit/primo_searcher_test.rb +325 -321
- data/test/unit/primo_service_test.rb +924 -919
- data/test/unit/primo_ws_test.rb +141 -138
- data/test/unit/service_test.rb +2 -16
- metadata +93 -100
- data/test/dummy/tmp/cache/assets/C73/920/sprockets%2Fd371318f22900492fd180f17c5e2a504 +0 -0
- data/test/dummy/tmp/cache/assets/C8F/780/sprockets%2Fe47e28558116fb5f8038754e60d1961d +0 -0
- data/test/dummy/tmp/cache/assets/CAA/EB0/sprockets%2F1d179210e8b76f1ea63c802688a015e4 +0 -9271
- data/test/dummy/tmp/cache/assets/CB2/DA0/sprockets%2Fa1808990b72376256db2ae3818c0e9b5 +0 -0
- data/test/dummy/tmp/cache/assets/CBB/9C0/sprockets%2F706f28923fb754cad04b9107c89986a1 +0 -0
- data/test/dummy/tmp/cache/assets/CDC/680/sprockets%2F2b68ef632d12610f3c9563168bfa7c05 +0 -0
- data/test/dummy/tmp/cache/assets/CEA/2A0/sprockets%2F9c8607157b998108ce08f4aca39f810a +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/D22/060/sprockets%2F9aec77b768e91a802d284271c58e2f7e +0 -0
- data/test/dummy/tmp/cache/assets/D33/6D0/sprockets%2F500129c57f1146e556ec3aacd6cd38c1 +0 -0
- data/test/dummy/tmp/cache/assets/D33/FD0/sprockets%2F2ba0b4e6334a77b923e5f770381bb2bf +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/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -873
- data/test/dummy/tmp/cache/assets/D5D/AD0/sprockets%2Fbdb053d9a6a967788f09fbc555d69f58 +0 -0
- data/test/dummy/tmp/cache/assets/D66/890/sprockets%2F06287a78ed20d8214197eab03bfca5dd +0 -0
- data/test/dummy/tmp/cache/assets/D6B/2A0/sprockets%2F81f17ab0ed20f4a8d9355f7a1d872eb2 +0 -0
- data/test/dummy/tmp/cache/assets/D70/080/sprockets%2F24d3ce40ae5cc827a9183b1fb837e84e +0 -0
- data/test/dummy/tmp/cache/assets/D71/6B0/sprockets%2Fde558b71b494cf09b1bf055c8dff0353 +0 -0
- data/test/dummy/tmp/cache/assets/D72/610/sprockets%2Fa8c708eeb30ef93de34d755d4f45d023 +0 -0
- data/test/dummy/tmp/cache/assets/D74/4C0/sprockets%2F64fdf30f75592d6e45fcfc45a48d20a2 +0 -0
- data/test/dummy/tmp/cache/assets/D76/AD0/sprockets%2Fe2158cde93188cf5ab6457bc6d6602ec +0 -0
- data/test/dummy/tmp/cache/assets/D7A/E40/sprockets%2F9622ffcc499a57627cd1bb18fe31b8e4 +0 -11772
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D9B/770/sprockets%2F8aacf02eb7dbb0949704b28f27b87e0b +0 -0
- data/test/dummy/tmp/cache/assets/DF7/F30/sprockets%2F7bc16c4109b17fabe29f8ddbbf732d1c +0 -0
- data/test/dummy/tmp/cache/assets/E03/570/sprockets%2F493bdc0ac14cd4f57fdfe4253f992bde +0 -0
- data/test/dummy/tmp/cache/assets/E09/850/sprockets%2F4bf497a38ecfef660b2f0ebb852d5e9c +0 -0
- data/test/dummy/tmp/cache/assets/E0B/4B0/sprockets%2F7988df51a61c81ce6ede4a2d4c8cce4f +0 -377
- data/test/dummy/tmp/cache/assets/E6F/A00/sprockets%2Fd32bcea45ea04a6aaee95b3aa840cbab +0 -0
@@ -1,942 +1,947 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
class PrimoServiceTest < ActiveSupport::TestCase
|
3
|
-
|
4
|
-
|
5
|
-
@primo_definition = YAML.load( %{
|
6
|
-
type: PrimoService
|
7
|
-
priority: 2 # After SFX, to get SFX metadata enhancement
|
8
|
-
status: active
|
9
|
-
base_url: http://bobcat.library.nyu.edu
|
10
|
-
vid: NYU
|
11
|
-
institution: NYU
|
12
|
-
holding_search_institution: NYU
|
13
|
-
holding_search_text: Search for this title in BobCat.
|
14
|
-
suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
|
15
|
-
ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/'
|
16
|
-
service_types:
|
17
|
-
- primo_source
|
18
|
-
- holding_search
|
19
|
-
- fulltext
|
20
|
-
- table_of_contents
|
21
|
-
- referent_enhance
|
22
|
-
- cover_image
|
23
|
-
})
|
24
|
-
|
25
|
-
@base_url = @primo_definition["base_url"]
|
26
|
-
@vid = @primo_definition["vid"]
|
27
|
-
@institution = @primo_definition["institution"]
|
28
|
-
|
29
|
-
@primo_default = ServiceStore.instantiate_service!(
|
30
|
-
YAML.load(%{
|
31
|
-
type: PrimoService
|
32
|
-
service_id: NYUPrimo
|
33
|
-
priority: 2 # After SFX, to get SFX metadata enhancement
|
34
|
-
status: active
|
35
|
-
base_url: http://bobcat.library.nyu.edu
|
36
|
-
vid: NYU
|
37
|
-
institution: NYU
|
38
|
-
holding_search_institution: NYU
|
39
|
-
holding_search_text: Search for this title in BobCat.
|
40
|
-
suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
|
41
|
-
ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/'
|
42
|
-
service_types:
|
43
|
-
- holding
|
44
|
-
- holding_search
|
45
|
-
- fulltext
|
46
|
-
- table_of_contents
|
47
|
-
- referent_enhance
|
48
|
-
- cover_image
|
49
|
-
}), nil)
|
3
|
+
|
4
|
+
nyu_only_tests(self.name) do
|
50
5
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
6
|
+
fixtures :requests, :referents, :referent_values, :sfx_urls
|
7
|
+
def setup
|
8
|
+
@primo_definition = YAML.load( %{
|
9
|
+
type: PrimoService
|
10
|
+
priority: 2 # After SFX, to get SFX metadata enhancement
|
11
|
+
status: active
|
12
|
+
base_url: http://bobcat.library.nyu.edu
|
13
|
+
vid: NYU
|
14
|
+
institution: NYU
|
15
|
+
holding_search_institution: NYU
|
16
|
+
holding_search_text: Search for this title in BobCat.
|
17
|
+
suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
|
18
|
+
ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/'
|
19
|
+
service_types:
|
20
|
+
- primo_source
|
21
|
+
- holding_search
|
22
|
+
- fulltext
|
23
|
+
- table_of_contents
|
24
|
+
- referent_enhance
|
25
|
+
- cover_image
|
26
|
+
})
|
27
|
+
|
28
|
+
@base_url = @primo_definition["base_url"]
|
29
|
+
@vid = @primo_definition["vid"]
|
30
|
+
@institution = @primo_definition["institution"]
|
31
|
+
|
32
|
+
@primo_default = ServiceStore.instantiate_service!(
|
33
|
+
YAML.load(%{
|
34
|
+
type: PrimoService
|
35
|
+
service_id: NYUPrimo
|
36
|
+
priority: 2 # After SFX, to get SFX metadata enhancement
|
37
|
+
status: active
|
38
|
+
base_url: http://bobcat.library.nyu.edu
|
39
|
+
vid: NYU
|
40
|
+
institution: NYU
|
41
|
+
holding_search_institution: NYU
|
42
|
+
holding_search_text: Search for this title in BobCat.
|
43
|
+
suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
|
44
|
+
ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/'
|
45
|
+
service_types:
|
46
|
+
- holding
|
47
|
+
- holding_search
|
48
|
+
- fulltext
|
49
|
+
- table_of_contents
|
50
|
+
- referent_enhance
|
51
|
+
- cover_image
|
71
52
|
}), nil)
|
53
|
+
|
54
|
+
@primo_tns = ServiceStore.instantiate_service!(
|
55
|
+
YAML.load(%{
|
56
|
+
type: PrimoService
|
57
|
+
priority: 2 # After SFX, to get SFX metadata enhancement
|
58
|
+
status: active
|
59
|
+
base_url: http://bobcat.library.nyu.edu
|
60
|
+
vid: NS
|
61
|
+
institution: NS
|
62
|
+
holding_search_institution: NS
|
63
|
+
holding_search_text: Search for this title in BobCat.
|
64
|
+
suppress_holdings: [ !ruby/regexp '/\$\$LBWEB/', !ruby/regexp '/\$\$LNWEB/', !ruby/regexp '/\$\$LTWEB/', !ruby/regexp '/\$\$LWEB/', !ruby/regexp '/\$\$1Restricted Internet Resources/' ]
|
65
|
+
ez_proxy: !ruby/regexp '/https\:\/\/ezproxy\.library\.nyu\.edu\/login\?url=/'
|
66
|
+
primo_config: tns_primo.yml
|
67
|
+
service_types:
|
68
|
+
- primo_source
|
69
|
+
- holding_search
|
70
|
+
- fulltext
|
71
|
+
- table_of_contents
|
72
|
+
- referent_enhance
|
73
|
+
- cover_image
|
74
|
+
}), nil)
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
@holding_search_institution =
|
79
|
+
@primo_minimum = PrimoService.new({
|
80
|
+
"priority"=>1, "service_id" => "Primo",
|
81
|
+
"base_url" => @base_url, "vid" => @vid, "institution" => @institution,
|
82
|
+
"holding_search_institution" => @primo_definition["holding_search_institution"] })
|
83
|
+
@primo_old_minimum = PrimoService.new({
|
84
|
+
"priority"=>1, "service_id" => "Primo",
|
85
|
+
"base_path" => @base_url, "base_view_id" => @vid, "institution" => @institution })
|
86
|
+
@primo_minimum_no_config = PrimoService.new({
|
87
|
+
"priority"=>1, "service_id" => "Primo",
|
88
|
+
"base_url" => @base_url, "vid" => @vid, "institution" => @institution,
|
89
|
+
"holding_search_institution" => @primo_definition["holding_search_institution"],
|
90
|
+
"primo_config" => "missing_config.yml" })
|
91
|
+
end
|
72
92
|
|
93
|
+
def test_primo_service_benchmarks
|
94
|
+
request = requests(:primo_id_request)
|
95
|
+
Benchmark.bmbm do |results|
|
96
|
+
results.report("PrimoService Minimum Config:") {
|
97
|
+
(1..10).each {
|
98
|
+
@primo_minimum.handle(request)
|
99
|
+
}
|
100
|
+
}
|
101
|
+
results.report("PrimoService Default Config:") {
|
102
|
+
(1..10).each {
|
103
|
+
@primo_default.handle(request)
|
104
|
+
}
|
105
|
+
}
|
106
|
+
end
|
107
|
+
end
|
108
|
+
#
|
109
|
+
# def test_to_primo_source_benchmarks
|
110
|
+
# request = requests(:primo_id_request)
|
111
|
+
# @primo_default.handle(request)
|
112
|
+
# service_type = request.get_service_type('primo_source', {}).first
|
113
|
+
# Benchmark.bmbm do |results|
|
114
|
+
# results.report("PrimoService :to_primo_source via view data - NYUAleph:") {
|
115
|
+
# (1..10).each {
|
116
|
+
# service_type.view_data
|
117
|
+
# }
|
118
|
+
# }
|
119
|
+
# service_response = service_type.service_response
|
120
|
+
# results.report("PrimoService :to_primo_source - NYUAleph:") {
|
121
|
+
# (1..10).each {
|
122
|
+
# @primo_default.to_primo_source(service_response)
|
123
|
+
# }
|
124
|
+
# }
|
125
|
+
# end
|
126
|
+
# end
|
127
|
+
#
|
128
|
+
# def test_primo_source_benchmarks
|
129
|
+
# request = requests(:primo_id_request)
|
130
|
+
# @primo_default.handle(request)
|
131
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
132
|
+
# Benchmark.bmbm do |results|
|
133
|
+
# results.report("PrimoSource - NYUAleph:") {
|
134
|
+
# (1..10).each {
|
135
|
+
# primo_source.handle(request)
|
136
|
+
# }
|
137
|
+
# }
|
138
|
+
# end
|
139
|
+
# end
|
140
|
+
#
|
141
|
+
# def test_source_expand_benchmarks
|
142
|
+
# request = requests(:primo_id_request)
|
143
|
+
# @primo_default.handle(request)
|
144
|
+
# primo_source = request.get_service_type('primo_source', {}).first.view_data
|
145
|
+
# Benchmark.bmbm do |results|
|
146
|
+
# results.report("PrimoSource :expand - NYUAleph:") {
|
147
|
+
# (1..10).each {
|
148
|
+
# primo_source.expand
|
149
|
+
# }
|
150
|
+
# }
|
151
|
+
# end
|
152
|
+
# end
|
73
153
|
|
154
|
+
def test_primo_service_minimum
|
155
|
+
request = requests(:primo_id_request)
|
156
|
+
@primo_minimum.handle(request)
|
157
|
+
request.referent.referent_values.reset
|
158
|
+
request.dispatched_services.reset
|
159
|
+
request.service_responses.reset
|
160
|
+
test_data = {
|
161
|
+
"aulast" => "Greene",
|
162
|
+
"aufirst" => "Graham,",
|
163
|
+
"au" => "Greene, Graham, 1904-1991",
|
164
|
+
"title" => "Travels with my aunt",
|
165
|
+
"btitle" => "Travels with my aunt",
|
166
|
+
"place" => "New York",
|
167
|
+
"pub" => "Penguin Books",
|
168
|
+
"oclcnum" => "56781200",
|
169
|
+
"lccn" => "2004559272"
|
170
|
+
}
|
171
|
+
test_data.each { |key, value|
|
172
|
+
assert_equal(
|
173
|
+
value,
|
174
|
+
request.referent.metadata[key],
|
175
|
+
"#{key} different than expected.")
|
176
|
+
}
|
177
|
+
holdings = request.get_service_type('holding')
|
178
|
+
assert_equal(
|
179
|
+
1, holdings.length)
|
180
|
+
test_data = {
|
181
|
+
:record_id => "nyu_aleph000062856",
|
182
|
+
:source_id => "nyu_aleph",
|
183
|
+
:original_source_id => "NYU01",
|
184
|
+
:source_record_id => "000062856",
|
185
|
+
:institution_code => "NYU",
|
186
|
+
:institution => "NYU",
|
187
|
+
:library_code => "BOBST",
|
188
|
+
:library => "NYU Bobst",
|
189
|
+
:status_code => "check_holdings",
|
190
|
+
:status => "Check Availability",
|
191
|
+
:id_one => "Main Collection",
|
192
|
+
:id_two => "(PR6013.R44 T7 2004 )",
|
193
|
+
:collection => "Main Collection",
|
194
|
+
:call_number => "(PR6013.R44 T7 2004 )",
|
195
|
+
:origin => nil,
|
196
|
+
:display_type => "book",
|
197
|
+
:coverage => [],
|
198
|
+
:notes => "",
|
199
|
+
:url => "#{@base_url}/primo_library/libweb/action/dlDisplay.do?docId=nyu_aleph000062856&institution=NYU&vid=#{@vid}",
|
200
|
+
:request_url => nil,
|
201
|
+
:match_reliability => ServiceResponse::MatchExact,
|
202
|
+
:request_link_supports_ajax_call => false }
|
203
|
+
test_data.each { |key, value|
|
204
|
+
assert_equal(
|
205
|
+
value,
|
206
|
+
holdings.first.view_data[key],
|
207
|
+
"#{key} different than expected.")
|
208
|
+
}
|
209
|
+
end
|
74
210
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
request = requests(:primo_id_request)
|
92
|
-
Benchmark.bmbm do |results|
|
93
|
-
results.report("PrimoService Minimum Config:") {
|
94
|
-
(1..10).each {
|
95
|
-
@primo_minimum.handle(request)
|
96
|
-
}
|
211
|
+
def test_primo_service_minimum_no_config
|
212
|
+
request = requests(:primo_id_request)
|
213
|
+
@primo_minimum_no_config.handle(request)
|
214
|
+
request.referent.referent_values.reset
|
215
|
+
request.dispatched_services.reset
|
216
|
+
request.service_responses.reset
|
217
|
+
test_data = {
|
218
|
+
"aulast" => "Greene",
|
219
|
+
"aufirst" => "Graham,",
|
220
|
+
"au" => "Greene, Graham, 1904-1991",
|
221
|
+
"title" => "Travels with my aunt",
|
222
|
+
"btitle" => "Travels with my aunt",
|
223
|
+
"place" => "New York",
|
224
|
+
"pub" => "Penguin Books",
|
225
|
+
"oclcnum" => "56781200",
|
226
|
+
"lccn" => "2004559272"
|
97
227
|
}
|
98
|
-
|
99
|
-
(
|
100
|
-
|
101
|
-
|
228
|
+
test_data.each { |key, value|
|
229
|
+
assert_equal(
|
230
|
+
value,
|
231
|
+
request.referent.metadata[key],
|
232
|
+
"#{key} different than expected.")
|
233
|
+
}
|
234
|
+
holdings = request.get_service_type('holding')
|
235
|
+
assert_equal(
|
236
|
+
1, holdings.length)
|
237
|
+
test_data = {
|
238
|
+
:record_id => "nyu_aleph000062856",
|
239
|
+
:source_id => "nyu_aleph",
|
240
|
+
:original_source_id => "NYU01",
|
241
|
+
:source_record_id => "000062856",
|
242
|
+
:institution_code => "NYU",
|
243
|
+
:institution => "NYU",
|
244
|
+
:library_code => "BOBST",
|
245
|
+
:library => "BOBST",
|
246
|
+
:status_code => "check_holdings",
|
247
|
+
:status => "check_holdings",
|
248
|
+
:id_one => "Main Collection",
|
249
|
+
:id_two => "(PR6013.R44 T7 2004 )",
|
250
|
+
:collection => "Main Collection",
|
251
|
+
:call_number => "(PR6013.R44 T7 2004 )",
|
252
|
+
:origin => nil,
|
253
|
+
:display_type => "book",
|
254
|
+
:coverage => [],
|
255
|
+
:notes => "",
|
256
|
+
:url => "#{@base_url}/primo_library/libweb/action/dlDisplay.do?docId=nyu_aleph000062856&institution=NYU&vid=#{@vid}",
|
257
|
+
:request_url => nil,
|
258
|
+
:match_reliability => ServiceResponse::MatchExact,
|
259
|
+
:request_link_supports_ajax_call => false }
|
260
|
+
test_data.each { |key, value|
|
261
|
+
assert_equal(
|
262
|
+
value,
|
263
|
+
holdings.first.view_data[key],
|
264
|
+
"#{key} different than expected.")
|
102
265
|
}
|
103
266
|
end
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
267
|
+
|
268
|
+
def test_primo_service_legacy_settings_minimum
|
269
|
+
request = requests(:primo_id_request)
|
270
|
+
@primo_old_minimum.handle(request)
|
271
|
+
request.referent.referent_values.reset
|
272
|
+
request.dispatched_services.reset
|
273
|
+
request.service_responses.reset
|
274
|
+
test_data = {
|
275
|
+
"aulast" => "Greene",
|
276
|
+
"aufirst" => "Graham,",
|
277
|
+
"au" => "Greene, Graham, 1904-1991",
|
278
|
+
"title" => "Travels with my aunt",
|
279
|
+
"btitle" => "Travels with my aunt",
|
280
|
+
"place" => "New York",
|
281
|
+
"pub" => "Penguin Books",
|
282
|
+
"oclcnum" => "56781200",
|
283
|
+
"lccn" => "2004559272"
|
284
|
+
}
|
285
|
+
test_data.each { |key, value|
|
286
|
+
assert_equal(
|
287
|
+
value,
|
288
|
+
request.referent.metadata[key],
|
289
|
+
"#{key} different than expected.")
|
290
|
+
}
|
291
|
+
holdings = request.get_service_type('holding')
|
292
|
+
assert_equal(
|
293
|
+
1, holdings.length)
|
294
|
+
test_data = {
|
295
|
+
:record_id => "nyu_aleph000062856",
|
296
|
+
:source_id => "nyu_aleph",
|
297
|
+
:original_source_id => "NYU01",
|
298
|
+
:source_record_id => "000062856",
|
299
|
+
:institution_code => "NYU",
|
300
|
+
:institution => "NYU",
|
301
|
+
:library_code => "BOBST",
|
302
|
+
:library => "NYU Bobst",
|
303
|
+
:status_code => "check_holdings",
|
304
|
+
:status => "Check Availability",
|
305
|
+
:id_one => "Main Collection",
|
306
|
+
:id_two => "(PR6013.R44 T7 2004 )",
|
307
|
+
:collection => "Main Collection",
|
308
|
+
:call_number => "(PR6013.R44 T7 2004 )",
|
309
|
+
:origin => nil,
|
310
|
+
:display_type => "book",
|
311
|
+
:coverage => [],
|
312
|
+
:notes => "",
|
313
|
+
:url => "#{@base_url}/primo_library/libweb/action/dlDisplay.do?docId=nyu_aleph000062856&institution=NYU&vid=#{@vid}",
|
314
|
+
:request_url => nil,
|
315
|
+
:match_reliability => ServiceResponse::MatchExact,
|
316
|
+
:request_link_supports_ajax_call => false }
|
317
|
+
test_data.each { |key, value|
|
318
|
+
assert_equal(
|
319
|
+
value,
|
320
|
+
holdings.first.view_data[key],
|
321
|
+
"#{key} different than expected.")
|
322
|
+
}
|
323
|
+
end
|
324
|
+
|
325
|
+
# def test_available_nyu_aleph
|
326
|
+
# # Available
|
327
|
+
# request = requests(:primo_id_request)
|
328
|
+
# @primo_default.handle(request)
|
329
|
+
# request.dispatched_services.reset
|
330
|
+
# request.service_types.reset
|
331
|
+
# primo_sources = request.get_service_type('primo_source')
|
332
|
+
# assert_equal(
|
333
|
+
# 1, primo_sources.length)
|
334
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
335
|
+
# primo_source.handle(request)
|
336
|
+
# request.dispatched_services.reset
|
337
|
+
# request.service_types.reset
|
338
|
+
# holdings = request.get_service_type('holding')
|
339
|
+
# assert_equal(
|
340
|
+
# 1, holdings.length)
|
341
|
+
# test_data = {
|
342
|
+
# :record_id => "nyu_aleph000062856",
|
343
|
+
# :source_id => "nyu_aleph",
|
344
|
+
# :original_source_id => "NYU01",
|
345
|
+
# :source_record_id => "000062856",
|
346
|
+
# :institution_code => "NYU",
|
347
|
+
# :institution => "NYU",
|
348
|
+
# :library_code => "BOBST",
|
349
|
+
# :library => "NYU Bobst",
|
350
|
+
# :status_code => "available",
|
351
|
+
# :status => "Available",
|
352
|
+
# :id_one => "Main Collection",
|
353
|
+
# :id_two => "(PR6013.R44 T7 2004)",
|
354
|
+
# :collection => "Main Collection",
|
355
|
+
# :call_number => "(PR6013.R44 T7 2004)",
|
356
|
+
# :origin => nil,
|
357
|
+
# :display_type => "book",
|
358
|
+
# :coverage => [],
|
359
|
+
# :notes => "",
|
360
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
|
361
|
+
# :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
|
362
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
363
|
+
# :request_link_supports_ajax_call => true }
|
364
|
+
# test_data.each { |key, value|
|
365
|
+
# assert_equal(
|
366
|
+
# value,
|
367
|
+
# holdings.first.view_data[key],
|
368
|
+
# "#{key} different than expected.")
|
115
369
|
# }
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
370
|
+
# source_data = {
|
371
|
+
# :aleph_doc_library => "NYU01",
|
372
|
+
# :aleph_sub_library => "NYU Bobst",
|
373
|
+
# :aleph_sub_library_code => "BOBST",
|
374
|
+
# :aleph_collection => "Main Collection",
|
375
|
+
# :aleph_call_number => "(PR6013.R44 T7 2004)",
|
376
|
+
# :aleph_doc_number => "000062856",
|
377
|
+
# :aleph_url => "http://alephstage.library.nyu.edu",
|
378
|
+
# :illiad_url => "http://illiaddev.library.nyu.edu",
|
379
|
+
# :aleph_sub_library_code => "BOBST",
|
380
|
+
# :aleph_item_id => "NYU50000062856000010",
|
381
|
+
# :aleph_item_adm_library => "NYU50",
|
382
|
+
# :aleph_item_sub_library_code => "BOBST",
|
383
|
+
# :aleph_item_collection_code => "MAIN",
|
384
|
+
# :aleph_item_doc_number => "000062856",
|
385
|
+
# :aleph_item_sequence_number => "1.0",
|
386
|
+
# :aleph_item_barcode => "31142041146104",
|
387
|
+
# :aleph_item_status_code => "01",
|
388
|
+
# :aleph_item_process_status_code => nil,
|
389
|
+
# :aleph_item_circulation_status => "On Shelf",
|
390
|
+
# :aleph_item_location => "PR6013.R44 T7 2004",
|
391
|
+
# :aleph_item_description => nil,
|
392
|
+
# :aleph_item_hol_doc_number => "002992203"
|
393
|
+
# }
|
394
|
+
# source_data.each { |key, value|
|
395
|
+
# assert_equal(
|
396
|
+
# value,
|
397
|
+
# holdings.first.view_data[:source_data][key],
|
398
|
+
# "#{key} different than expected.")
|
121
399
|
# }
|
122
400
|
# end
|
401
|
+
#
|
402
|
+
# def test_available_tns_aleph
|
403
|
+
# # Available
|
404
|
+
# request = requests(:primo_id_request)
|
405
|
+
# @primo_tns.handle(request)
|
406
|
+
# request.dispatched_services.reset
|
407
|
+
# request.service_types.reset
|
408
|
+
# primo_sources = request.get_service_type('primo_source')
|
409
|
+
# assert_equal(
|
410
|
+
# 1, primo_sources.length)
|
411
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
412
|
+
# primo_source.handle(request)
|
413
|
+
# request.dispatched_services.reset
|
414
|
+
# request.service_types.reset
|
415
|
+
# holdings = request.get_service_type('holding')
|
416
|
+
# assert_equal(
|
417
|
+
# 1, holdings.length)
|
418
|
+
# test_data = {
|
419
|
+
# :record_id => "nyu_aleph000062856",
|
420
|
+
# :source_id => "nyu_aleph",
|
421
|
+
# :original_source_id => "NYU01",
|
422
|
+
# :source_record_id => "000062856",
|
423
|
+
# :institution_code => "NYU",
|
424
|
+
# :institution => "NYU",
|
425
|
+
# :library_code => "BOBST",
|
426
|
+
# :library => "NYU Bobst",
|
427
|
+
# :status_code => "available",
|
428
|
+
# :status => "Available",
|
429
|
+
# :id_one => "Main Collection",
|
430
|
+
# :id_two => "(PR6013.R44 T7 2004)",
|
431
|
+
# :collection => "Main Collection",
|
432
|
+
# :call_number => "(PR6013.R44 T7 2004)",
|
433
|
+
# :origin => nil,
|
434
|
+
# :display_type => "book",
|
435
|
+
# :coverage => [],
|
436
|
+
# :notes => "",
|
437
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000062856&sub_library=BOBST",
|
438
|
+
# :request_url => nil,
|
439
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
440
|
+
# :request_link_supports_ajax_call => true }
|
441
|
+
# test_data.each { |key, value|
|
442
|
+
# assert_equal(
|
443
|
+
# value,
|
444
|
+
# holdings.first.view_data[key],
|
445
|
+
# "#{key} different than expected.")
|
446
|
+
# }
|
447
|
+
# source_data = {
|
448
|
+
# :aleph_doc_library => "NYU01",
|
449
|
+
# :aleph_sub_library => "NYU Bobst",
|
450
|
+
# :aleph_sub_library_code => "BOBST",
|
451
|
+
# :aleph_collection => "Main Collection",
|
452
|
+
# :aleph_call_number => "(PR6013.R44 T7 2004)",
|
453
|
+
# :aleph_doc_number => "000062856",
|
454
|
+
# :aleph_url => "http://alephstage.library.nyu.edu",
|
455
|
+
# :illiad_url => "http://illiaddev.library.nyu.edu",
|
456
|
+
# :aleph_sub_library_code => "BOBST",
|
457
|
+
# :aleph_item_id => "NYU50000062856000010",
|
458
|
+
# :aleph_item_adm_library => "NYU50",
|
459
|
+
# :aleph_item_sub_library_code => "BOBST",
|
460
|
+
# :aleph_item_collection_code => "MAIN",
|
461
|
+
# :aleph_item_doc_number => "000062856",
|
462
|
+
# :aleph_item_sequence_number => "1.0",
|
463
|
+
# :aleph_item_barcode => "31142041146104",
|
464
|
+
# :aleph_item_status_code => "01",
|
465
|
+
# :aleph_item_process_status_code => nil,
|
466
|
+
# :aleph_item_circulation_status => "On Shelf",
|
467
|
+
# :aleph_item_location => "PR6013.R44 T7 2004",
|
468
|
+
# :aleph_item_description => nil,
|
469
|
+
# :aleph_item_hol_doc_number => "002992203"
|
470
|
+
# }
|
471
|
+
# source_data.each { |key, value|
|
472
|
+
# assert_equal(
|
473
|
+
# value,
|
474
|
+
# holdings.first.view_data[:source_data][key],
|
475
|
+
# "#{key} different than expected.")
|
476
|
+
# }
|
123
477
|
# end
|
124
478
|
#
|
125
|
-
# def
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
479
|
+
# def test_checked_out_nyu_aleph
|
480
|
+
# request = requests(:primo_checked_out_request)
|
481
|
+
# @primo_default.handle(request)
|
482
|
+
# request.referent.referent_values.reset
|
483
|
+
# request.dispatched_services.reset
|
484
|
+
# request.service_types.reset
|
485
|
+
# primo_sources = request.get_service_type('primo_source')
|
486
|
+
# assert_equal(
|
487
|
+
# 1, primo_sources.length)
|
488
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
489
|
+
# primo_source.handle(request)
|
490
|
+
# request.dispatched_services.reset
|
491
|
+
# request.service_types.reset
|
492
|
+
# holdings = request.get_service_type('holding')
|
493
|
+
# assert_equal(
|
494
|
+
# 1, holdings.length)
|
495
|
+
# test_data = {
|
496
|
+
# :record_id => "nyu_aleph000742457",
|
497
|
+
# :source_id => "nyu_aleph",
|
498
|
+
# :original_source_id => "NYU01",
|
499
|
+
# :source_record_id => "000742457",
|
500
|
+
# :institution_code => "NYU",
|
501
|
+
# :institution => "NYU",
|
502
|
+
# :library_code => "BOBST",
|
503
|
+
# :library => "NYU Bobst",
|
504
|
+
# :status_code => "checked_out",
|
505
|
+
# :status => "Due: 08/25/11",
|
506
|
+
# :id_one => "Main Collection",
|
507
|
+
# :id_two => "(DR557 .J86 2001)",
|
508
|
+
# :collection => "Main Collection",
|
509
|
+
# :call_number => "(DR557 .J86 2001)",
|
510
|
+
# :origin => nil,
|
511
|
+
# :display_type => "book",
|
512
|
+
# :coverage => [],
|
513
|
+
# :notes => "",
|
514
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000742457&sub_library=BOBST",
|
515
|
+
# :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000742457&sub_library=BOBST",
|
516
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
517
|
+
# :request_link_supports_ajax_call => true }
|
518
|
+
# test_data.each { |key, value|
|
519
|
+
# assert_equal(
|
520
|
+
# value,
|
521
|
+
# holdings.first.view_data[key],
|
522
|
+
# "#{key} different than expected.")
|
523
|
+
# }
|
524
|
+
# source_data = {
|
525
|
+
# :aleph_doc_library => "NYU01",
|
526
|
+
# :aleph_sub_library => "NYU Bobst",
|
527
|
+
# :aleph_sub_library_code => "BOBST",
|
528
|
+
# :aleph_collection => "Main Collection",
|
529
|
+
# :aleph_call_number => "(DR557 .J86 2001)",
|
530
|
+
# :aleph_doc_number => "000742457",
|
531
|
+
# :aleph_url => "http://alephstage.library.nyu.edu",
|
532
|
+
# :illiad_url => "http://illiaddev.library.nyu.edu",
|
533
|
+
# :aleph_sub_library_code => "BOBST",
|
534
|
+
# :aleph_item_id => "NYU50000742457000010",
|
535
|
+
# :aleph_item_adm_library => "NYU50",
|
536
|
+
# :aleph_item_sub_library_code => "BOBST",
|
537
|
+
# :aleph_item_collection_code => "MAIN",
|
538
|
+
# :aleph_item_doc_number => "000742457",
|
539
|
+
# :aleph_item_sequence_number => "1.0",
|
540
|
+
# :aleph_item_barcode => "31142031951646",
|
541
|
+
# :aleph_item_status_code => "01",
|
542
|
+
# :aleph_item_process_status_code => nil,
|
543
|
+
# :aleph_item_circulation_status => "08/25/11",
|
544
|
+
# :aleph_item_location => "DR557 .J86 2001",
|
545
|
+
# :aleph_item_description => nil,
|
546
|
+
# :aleph_item_hol_doc_number => "002815266"
|
547
|
+
# }
|
548
|
+
# source_data.each { |key, value|
|
549
|
+
# assert_equal(
|
550
|
+
# value,
|
551
|
+
# holdings.first.view_data[:source_data][key],
|
552
|
+
# "#{key} different than expected.")
|
134
553
|
# }
|
135
|
-
# end
|
136
554
|
# end
|
137
555
|
#
|
138
|
-
# def
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
556
|
+
# def test_in_process_nyu_aleph
|
557
|
+
# request = requests(:primo_bobst_in_processing_request)
|
558
|
+
# @primo_default.handle(request)
|
559
|
+
# request.referent.referent_values.reset
|
560
|
+
# request.dispatched_services.reset
|
561
|
+
# request.service_types.reset
|
562
|
+
# primo_sources = request.get_service_type('primo_source')
|
563
|
+
# assert_equal(
|
564
|
+
# 1, primo_sources.length)
|
565
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
566
|
+
# primo_source.handle(request)
|
567
|
+
# request.dispatched_services.reset
|
568
|
+
# request.service_types.reset
|
569
|
+
# holdings = request.get_service_type('holding')
|
570
|
+
# assert_equal(
|
571
|
+
# 1, holdings.length)
|
572
|
+
# test_data = {
|
573
|
+
# :record_id => "nyu_aleph002723601",
|
574
|
+
# :source_id => "nyu_aleph",
|
575
|
+
# :original_source_id => "NYU01",
|
576
|
+
# :source_record_id => "002723601",
|
577
|
+
# :institution_code => "NYU",
|
578
|
+
# :institution => "NYU",
|
579
|
+
# :library_code => "BOBST",
|
580
|
+
# :library => "NYU Bobst",
|
581
|
+
# :status_code => "overridden_by_nyu_aleph",
|
582
|
+
# :status => "In Processing",
|
583
|
+
# :id_one => "Main Collection",
|
584
|
+
# :id_two => "(PN691 .B78 1983)",
|
585
|
+
# :collection => "Main Collection",
|
586
|
+
# :call_number => "(PN691 .B78 1983)",
|
587
|
+
# :origin => nil,
|
588
|
+
# :display_type => "book",
|
589
|
+
# :coverage => [],
|
590
|
+
# :notes => "",
|
591
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002723601&sub_library=BOBST",
|
592
|
+
# :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002723601&sub_library=BOBST",
|
593
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
594
|
+
# :request_link_supports_ajax_call => true }
|
595
|
+
# test_data.each { |key, value|
|
596
|
+
# assert_equal(
|
597
|
+
# value,
|
598
|
+
# holdings.first.view_data[key],
|
599
|
+
# "#{key} different than expected.")
|
600
|
+
# }
|
601
|
+
# source_data = {
|
602
|
+
# :aleph_doc_library => "NYU01",
|
603
|
+
# :aleph_sub_library => "NYU Bobst",
|
604
|
+
# :aleph_sub_library_code => "BOBST",
|
605
|
+
# :aleph_collection => "Main Collection",
|
606
|
+
# :aleph_call_number => "(PN691 .B78 1983)",
|
607
|
+
# :aleph_doc_number => "002723601",
|
608
|
+
# :aleph_url => "http://alephstage.library.nyu.edu",
|
609
|
+
# :illiad_url => "http://illiaddev.library.nyu.edu",
|
610
|
+
# :aleph_sub_library_code => "BOBST",
|
611
|
+
# :aleph_item_id => "NYU50002723601000010",
|
612
|
+
# :aleph_item_adm_library => "NYU50",
|
613
|
+
# :aleph_item_sub_library_code => "BOBST",
|
614
|
+
# :aleph_item_collection_code => "MAIN",
|
615
|
+
# :aleph_item_doc_number => "002723601",
|
616
|
+
# :aleph_item_sequence_number => "1.0",
|
617
|
+
# :aleph_item_barcode => "31142011075952",
|
618
|
+
# :aleph_item_status_code => "01",
|
619
|
+
# :aleph_item_process_status_code => "BD",
|
620
|
+
# :aleph_item_circulation_status => "At Bindery",
|
621
|
+
# :aleph_item_location => "PN691 .B78 1983",
|
622
|
+
# :aleph_item_description => nil,
|
623
|
+
# :aleph_item_hol_doc_number => "000631538"
|
624
|
+
# }
|
625
|
+
# source_data.each { |key, value|
|
626
|
+
# assert_equal(
|
627
|
+
# value,
|
628
|
+
# holdings.first.view_data[:source_data][key],
|
629
|
+
# "#{key} different than expected.")
|
147
630
|
# }
|
148
|
-
# end
|
149
631
|
# end
|
632
|
+
#
|
633
|
+
# def test_journal1_nyu_aleph
|
634
|
+
# request = requests(:primo_journal1_request)
|
635
|
+
# @primo_default.handle(request)
|
636
|
+
# request.referent.referent_values.reset
|
637
|
+
# request.dispatched_services.reset
|
638
|
+
# request.service_types.reset
|
639
|
+
# primo_sources = request.get_service_type('primo_source')
|
640
|
+
# assert_equal(
|
641
|
+
# 4, primo_sources.length)
|
642
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
643
|
+
# primo_source.handle(request)
|
644
|
+
# request.dispatched_services.reset
|
645
|
+
# request.service_types.reset
|
646
|
+
# holdings = request.get_service_type('holding')
|
647
|
+
# assert_equal(
|
648
|
+
# 4, holdings.length)
|
649
|
+
# test_data = {
|
650
|
+
# :record_id => "nyu_aleph002895625",
|
651
|
+
# :source_id => "nyu_aleph",
|
652
|
+
# :original_source_id => "NYU01",
|
653
|
+
# :source_record_id => "002895625",
|
654
|
+
# :institution_code => "NYU",
|
655
|
+
# :institution => "NYU",
|
656
|
+
# :library_code => "BOBST",
|
657
|
+
# :library => "NYU Bobst",
|
658
|
+
# :status_code => "check_holdings",
|
659
|
+
# :status => "Check Availability",
|
660
|
+
# :id_one => "Main Collection",
|
661
|
+
# :id_two => "(ML1 .M819 )",
|
662
|
+
# :collection => "Main Collection",
|
663
|
+
# :call_number => "(ML1 .M819 )",
|
664
|
+
# :origin => nil,
|
665
|
+
# :display_type => "journal",
|
666
|
+
# :coverage => ["Available in Main Collection: VOLUMES: 1-89 (YEARS: 1915-2006)"],
|
667
|
+
# :notes => "",
|
668
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002895625&sub_library=BOBST",
|
669
|
+
# :request_url => nil,
|
670
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
671
|
+
# :request_link_supports_ajax_call => false }
|
672
|
+
# test_data.each { |key, value|
|
673
|
+
# assert_equal(
|
674
|
+
# value,
|
675
|
+
# holdings.first.view_data[key],
|
676
|
+
# "#{key} different than expected.")
|
677
|
+
# }
|
678
|
+
# source_data = {
|
679
|
+
# :aleph_doc_library => "NYU01",
|
680
|
+
# :aleph_sub_library => "NYU Bobst",
|
681
|
+
# :aleph_sub_library_code => "BOBST",
|
682
|
+
# :aleph_collection => "Main Collection",
|
683
|
+
# :aleph_call_number => "(ML1 .M819 )",
|
684
|
+
# :aleph_doc_number => "002895625",
|
685
|
+
# :aleph_sub_library_code => "BOBST"
|
686
|
+
# }
|
687
|
+
# source_data.each { |key, value|
|
688
|
+
# assert_equal(
|
689
|
+
# value,
|
690
|
+
# holdings.first.view_data[:source_data][key],
|
691
|
+
# "#{key} different than expected.")
|
692
|
+
# }
|
693
|
+
# end
|
694
|
+
#
|
695
|
+
# def test_journal1_tns_aleph
|
696
|
+
# request = requests(:primo_journal1_request)
|
697
|
+
# @primo_tns.handle(request)
|
698
|
+
# request.referent.referent_values.reset
|
699
|
+
# request.dispatched_services.reset
|
700
|
+
# request.service_types.reset
|
701
|
+
# primo_sources = request.get_service_type('primo_source')
|
702
|
+
# assert_equal(
|
703
|
+
# 4, primo_sources.length)
|
704
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
705
|
+
# primo_source.handle(request)
|
706
|
+
# request.dispatched_services.reset
|
707
|
+
# request.service_types.reset
|
708
|
+
# holdings = request.get_service_type('holding')
|
709
|
+
# assert_equal(
|
710
|
+
# 4, holdings.length)
|
711
|
+
# test_data = {
|
712
|
+
# :record_id => "nyu_aleph002895625",
|
713
|
+
# :source_id => "nyu_aleph",
|
714
|
+
# :original_source_id => "NYU01",
|
715
|
+
# :source_record_id => "002895625",
|
716
|
+
# :institution_code => "NYU",
|
717
|
+
# :institution => "NYU",
|
718
|
+
# :library_code => "BOBST",
|
719
|
+
# :library => "NYU Bobst",
|
720
|
+
# :status_code => "check_holdings",
|
721
|
+
# :status => "Check Availability",
|
722
|
+
# :id_one => "Main Collection",
|
723
|
+
# :id_two => "(ML1 .M819 )",
|
724
|
+
# :collection => "Main Collection",
|
725
|
+
# :call_number => "(ML1 .M819 )",
|
726
|
+
# :origin => nil,
|
727
|
+
# :display_type => "journal",
|
728
|
+
# :coverage => ["Available in Main Collection: VOLUMES: 1-89 (YEARS: 1915-2006)"],
|
729
|
+
# :notes => "",
|
730
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=002895625&sub_library=BOBST",
|
731
|
+
# :request_url => nil,
|
732
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
733
|
+
# :request_link_supports_ajax_call => false }
|
734
|
+
# test_data.each { |key, value|
|
735
|
+
# assert_equal(
|
736
|
+
# value,
|
737
|
+
# holdings.first.view_data[key],
|
738
|
+
# "#{key} different than expected.")
|
739
|
+
# }
|
740
|
+
# source_data = {
|
741
|
+
# :aleph_doc_library => "NYU01",
|
742
|
+
# :aleph_sub_library => "NYU Bobst",
|
743
|
+
# :aleph_sub_library_code => "BOBST",
|
744
|
+
# :aleph_collection => "Main Collection",
|
745
|
+
# :aleph_call_number => "(ML1 .M819 )",
|
746
|
+
# :aleph_doc_number => "002895625",
|
747
|
+
# :aleph_sub_library_code => "BOBST"
|
748
|
+
# }
|
749
|
+
# source_data.each { |key, value|
|
750
|
+
# assert_equal(
|
751
|
+
# value,
|
752
|
+
# holdings.first.view_data[:source_data][key],
|
753
|
+
# "#{key} different than expected.")
|
754
|
+
# }
|
755
|
+
# end
|
756
|
+
#
|
757
|
+
# def test_journal2_nyu_aleph
|
758
|
+
# # Journal 2
|
759
|
+
# request = requests(:primo_journal2_request)
|
760
|
+
# @primo_default.handle(request)
|
761
|
+
# request.referent.referent_values.reset
|
762
|
+
# request.dispatched_services.reset
|
763
|
+
# request.service_types.reset
|
764
|
+
# # record_id = request.referent.metadata["primo"]
|
765
|
+
# assert_equal("Macomb", request.referent.metadata["place"]);
|
766
|
+
# assert_equal("Center for Business and Economic Research, Western Illinois University]", request.referent.metadata["pub"]);
|
767
|
+
# primo_sources = request.get_service_type('primo_source')
|
768
|
+
# assert(1 <= primo_sources.length)
|
769
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
770
|
+
# primo_source.handle(request)
|
771
|
+
# request.dispatched_services.reset
|
772
|
+
# request.service_types.reset
|
773
|
+
# holdings = request.get_service_type('holding')
|
774
|
+
# assert(1 <= holdings.length)
|
775
|
+
# assert_equal(primo_sources.length, holdings.length)
|
776
|
+
# assert_equal("NYU", holdings.first.view_data[:institution])
|
777
|
+
# assert_equal("NYU Bobst", holdings.first.view_data[:library])
|
778
|
+
# assert_equal("Main Collection", holdings.first.view_data[:id_one])
|
779
|
+
# 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])
|
780
|
+
# assert_equal("(HB1 .J55 )", holdings.first.view_data[:id_two])
|
781
|
+
# assert_equal("Check Availability", holdings.first.view_data[:status])
|
782
|
+
# end
|
783
|
+
#
|
784
|
+
# def test_journal3_nyu_aleph
|
785
|
+
# # Journal 3
|
786
|
+
# request = requests(:primo_journal3_request)
|
787
|
+
# @primo_default.handle(request)
|
788
|
+
# request.referent.referent_values.reset
|
789
|
+
# request.dispatched_services.reset
|
790
|
+
# request.service_types.reset
|
791
|
+
# # record_id = request.referent.metadata["primo"]
|
792
|
+
# assert_equal("Sydney", request.referent.metadata["place"]);
|
793
|
+
# assert_equal("Association for the Journal of Religious History]", request.referent.metadata["pub"]);
|
794
|
+
# primo_sources = request.get_service_type('primo_source')
|
795
|
+
# assert_equal(0, primo_sources.length)
|
796
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
797
|
+
# primo_source.handle(request)
|
798
|
+
# request.dispatched_services.reset
|
799
|
+
# request.service_types.reset
|
800
|
+
# holdings = request.get_service_type('holding')
|
801
|
+
# assert_equal(0, holdings.length)
|
802
|
+
# assert_equal(primo_sources.length, holdings.length)
|
803
|
+
# end
|
804
|
+
#
|
805
|
+
# def test_journal4_nyu_aleph
|
806
|
+
# # Journal 4
|
807
|
+
# request = requests(:primo_journal4_request)
|
808
|
+
# @primo_default.handle(request)
|
809
|
+
# request.referent.referent_values.reset
|
810
|
+
# request.dispatched_services.reset
|
811
|
+
# request.service_types.reset
|
812
|
+
# # record_id = request.referent.metadata["primo"]
|
813
|
+
# assert_equal("Waltham, MA", request.referent.metadata["place"]);
|
814
|
+
# assert_equal("Published for the Board by the Massachusetts Medical Society", request.referent.metadata["pub"]);
|
815
|
+
# primo_sources = request.get_service_type('primo_source')
|
816
|
+
# assert_equal(0, primo_sources.length)
|
817
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
818
|
+
# primo_source.handle(request)
|
819
|
+
# request.dispatched_services.reset
|
820
|
+
# request.service_types.reset
|
821
|
+
# holdings = request.get_service_type('holding')
|
822
|
+
# assert_equal(0, holdings.length)
|
823
|
+
# assert_equal(primo_sources.length, holdings.length)
|
824
|
+
# end
|
825
|
+
#
|
826
|
+
# def test_journal5_nyu_aleph
|
827
|
+
# request = requests(:primo_journal5_request)
|
828
|
+
# @primo_default.handle(request)
|
829
|
+
# request.referent.referent_values.reset
|
830
|
+
# request.dispatched_services.reset
|
831
|
+
# request.service_types.reset
|
832
|
+
# # record_id = request.referent.metadata["primo"]
|
833
|
+
# primo_sources = request.get_service_type('primo_source')
|
834
|
+
# assert_equal(1, primo_sources.length)
|
835
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
836
|
+
# primo_source.handle(request)
|
837
|
+
# request.dispatched_services.reset
|
838
|
+
# request.service_types.reset
|
839
|
+
# holdings = request.get_service_type('holding')
|
840
|
+
# assert_equal(1, holdings.length)
|
841
|
+
# assert_equal(primo_sources.length, holdings.length)
|
842
|
+
# end
|
843
|
+
#
|
844
|
+
# def test_bobst_genre_discrepancy
|
845
|
+
# request = requests(:primo_bobst_problem1_request)
|
846
|
+
# @primo_default.handle(request)
|
847
|
+
# request.dispatched_services.reset
|
848
|
+
# request.service_types.reset
|
849
|
+
# primo_sources = request.get_service_type('primo_source')
|
850
|
+
# assert_equal(
|
851
|
+
# 1, primo_sources.length)
|
852
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
853
|
+
# primo_source.handle(request)
|
854
|
+
# request.dispatched_services.reset
|
855
|
+
# request.service_types.reset
|
856
|
+
# holdings = request.get_service_type('holding')
|
857
|
+
# assert_equal(
|
858
|
+
# 1, holdings.length)
|
859
|
+
# test_data = {
|
860
|
+
# :record_id => "nyu_aleph000509288",
|
861
|
+
# :source_id => "nyu_aleph",
|
862
|
+
# :original_source_id => "NYU01",
|
863
|
+
# :source_record_id => "000509288",
|
864
|
+
# :institution_code => "NYU",
|
865
|
+
# :institution => "NYU",
|
866
|
+
# :library_code => "BOBST",
|
867
|
+
# :library => "NYU Bobst",
|
868
|
+
# :status_code => "available",
|
869
|
+
# :status => "Available",
|
870
|
+
# :id_one => "Main Collection",
|
871
|
+
# :id_two => "(ML410.J33 M47 2005a)",
|
872
|
+
# :collection => "Main Collection",
|
873
|
+
# :call_number => "(ML410.J33 M47 2005a)",
|
874
|
+
# :origin => nil,
|
875
|
+
# :display_type => "book",
|
876
|
+
# :coverage => [],
|
877
|
+
# :notes => "",
|
878
|
+
# :url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000509288&sub_library=BOBST",
|
879
|
+
# :request_url => "http://alephstage.library.nyu.edu/F?func=item-global&doc_library=NYU01&local_base=PRIMOCOMMON&doc_number=000509288&sub_library=BOBST",
|
880
|
+
# :match_reliability => ServiceResponse::MatchExact,
|
881
|
+
# :request_link_supports_ajax_call => true }
|
882
|
+
# test_data.each { |key, value|
|
883
|
+
# assert_equal(
|
884
|
+
# value,
|
885
|
+
# holdings.first.view_data[key],
|
886
|
+
# "#{key} different than expected.")
|
887
|
+
# }
|
888
|
+
# source_data = {
|
889
|
+
# :aleph_doc_library => "NYU01",
|
890
|
+
# :aleph_sub_library => "NYU Bobst",
|
891
|
+
# :aleph_sub_library_code => "BOBST",
|
892
|
+
# :aleph_collection => "Main Collection",
|
893
|
+
# :aleph_call_number => "(ML410.J33 M47 2005a)",
|
894
|
+
# :aleph_doc_number => "000509288",
|
895
|
+
# :aleph_url => "http://alephstage.library.nyu.edu",
|
896
|
+
# :illiad_url => "http://illiaddev.library.nyu.edu",
|
897
|
+
# :aleph_sub_library_code => "BOBST",
|
898
|
+
# :aleph_item_id => "NYU50000509288000010",
|
899
|
+
# :aleph_item_adm_library => "NYU50",
|
900
|
+
# :aleph_item_sub_library_code => "BOBST",
|
901
|
+
# :aleph_item_collection_code => "MAIN",
|
902
|
+
# :aleph_item_doc_number => "000509288",
|
903
|
+
# :aleph_item_sequence_number => "1.0",
|
904
|
+
# :aleph_item_barcode => "31142045676163",
|
905
|
+
# :aleph_item_status_code => "01",
|
906
|
+
# :aleph_item_process_status_code => nil,
|
907
|
+
# :aleph_item_circulation_status => "On Shelf",
|
908
|
+
# :aleph_item_location => "ML410.J33 M47 2005a",
|
909
|
+
# :aleph_item_description => nil,
|
910
|
+
# :aleph_item_hol_doc_number => "003227224"
|
911
|
+
# }
|
912
|
+
# source_data.each { |key, value|
|
913
|
+
# assert_equal(
|
914
|
+
# value,
|
915
|
+
# holdings.first.view_data[:source_data][key],
|
916
|
+
# "#{key} different than expected.")
|
917
|
+
# }
|
918
|
+
# end
|
919
|
+
#
|
920
|
+
# def test_critical_inquiry_bug
|
921
|
+
# request = requests(:critical_inquiry_request)
|
922
|
+
# @primo_default.handle(request)
|
923
|
+
# request.dispatched_services.reset
|
924
|
+
# request.service_types.reset
|
925
|
+
# primo_sources = request.get_service_type('primo_source')
|
926
|
+
# assert_equal(
|
927
|
+
# 4, primo_sources.length)
|
928
|
+
# primo_source = ServiceList.instance.instantiate!("NYU_Primo_Source", nil)
|
929
|
+
# primo_source.handle(request)
|
930
|
+
# request.dispatched_services.reset
|
931
|
+
# request.service_types.reset
|
932
|
+
# holdings = request.get_service_type('holding')
|
933
|
+
# assert_equal(
|
934
|
+
# 4, holdings.length)
|
935
|
+
# end
|
936
|
+
#
|
937
|
+
# def test_sfx_owner_but_fulltext_empty
|
938
|
+
# request = requests(:sfx_owner_but_fulltext_empty_request)
|
939
|
+
# @primo_default.handle(request)
|
940
|
+
# request.dispatched_services.reset
|
941
|
+
# request.service_types.reset
|
942
|
+
# fulltext = request.get_service_type('fulltext')
|
943
|
+
# assert_equal(0, fulltext.length)
|
944
|
+
# end
|
150
945
|
|
151
|
-
def test_primo_service_minimum
|
152
|
-
request = requests(:primo_id_request)
|
153
|
-
@primo_minimum.handle(request)
|
154
|
-
request.referent.referent_values.reset
|
155
|
-
request.dispatched_services.reset
|
156
|
-
request.service_responses.reset
|
157
|
-
test_data = {
|
158
|
-
"aulast" => "Greene",
|
159
|
-
"aufirst" => "Graham,",
|
160
|
-
"au" => "Greene, Graham, 1904-1991",
|
161
|
-
"title" => "Travels with my aunt",
|
162
|
-
"btitle" => "Travels with my aunt",
|
163
|
-
"place" => "New York",
|
164
|
-
"pub" => "Penguin Books",
|
165
|
-
"oclcnum" => "56781200",
|
166
|
-
"lccn" => "2004559272"
|
167
|
-
}
|
168
|
-
test_data.each { |key, value|
|
169
|
-
assert_equal(
|
170
|
-
value,
|
171
|
-
request.referent.metadata[key],
|
172
|
-
"#{key} different than expected.")
|
173
|
-
}
|
174
|
-
holdings = request.get_service_type('holding')
|
175
|
-
assert_equal(
|
176
|
-
1, holdings.length)
|
177
|
-
test_data = {
|
178
|
-
:record_id => "nyu_aleph000062856",
|
179
|
-
:source_id => "nyu_aleph",
|
180
|
-
:original_source_id => "NYU01",
|
181
|
-
:source_record_id => "000062856",
|
182
|
-
:institution_code => "NYU",
|
183
|
-
:institution => "NYU",
|
184
|
-
:library_code => "BOBST",
|
185
|
-
:library => "NYU Bobst",
|
186
|
-
:status_code => "check_holdings",
|
187
|
-
:status => "Check Availability",
|
188
|
-
:id_one => "Main Collection",
|
189
|
-
:id_two => "(PR6013.R44 T7 2004 )",
|
190
|
-
:collection => "Main Collection",
|
191
|
-
:call_number => "(PR6013.R44 T7 2004 )",
|
192
|
-
:origin => nil,
|
193
|
-
:display_type => "book",
|
194
|
-
:coverage => [],
|
195
|
-
:notes => "",
|
196
|
-
:url => "#{@base_url}/primo_library/libweb/action/dlDisplay.do?docId=nyu_aleph000062856&institution=NYU&vid=#{@vid}",
|
197
|
-
:request_url => nil,
|
198
|
-
:match_reliability => ServiceResponse::MatchExact,
|
199
|
-
:request_link_supports_ajax_call => false }
|
200
|
-
test_data.each { |key, value|
|
201
|
-
assert_equal(
|
202
|
-
value,
|
203
|
-
holdings.first.view_data[key],
|
204
|
-
"#{key} different than expected.")
|
205
|
-
}
|
206
|
-
end
|
207
|
-
|
208
|
-
def test_primo_service_minimum_no_config
|
209
|
-
request = requests(:primo_id_request)
|
210
|
-
@primo_minimum_no_config.handle(request)
|
211
|
-
request.referent.referent_values.reset
|
212
|
-
request.dispatched_services.reset
|
213
|
-
request.service_responses.reset
|
214
|
-
test_data = {
|
215
|
-
"aulast" => "Greene",
|
216
|
-
"aufirst" => "Graham,",
|
217
|
-
"au" => "Greene, Graham, 1904-1991",
|
218
|
-
"title" => "Travels with my aunt",
|
219
|
-
"btitle" => "Travels with my aunt",
|
220
|
-
"place" => "New York",
|
221
|
-
"pub" => "Penguin Books",
|
222
|
-
"oclcnum" => "56781200",
|
223
|
-
"lccn" => "2004559272"
|
224
|
-
}
|
225
|
-
test_data.each { |key, value|
|
226
|
-
assert_equal(
|
227
|
-
value,
|
228
|
-
request.referent.metadata[key],
|
229
|
-
"#{key} different than expected.")
|
230
|
-
}
|
231
|
-
holdings = request.get_service_type('holding')
|
232
|
-
assert_equal(
|
233
|
-
1, holdings.length)
|
234
|
-
test_data = {
|
235
|
-
:record_id => "nyu_aleph000062856",
|
236
|
-
:source_id => "nyu_aleph",
|
237
|
-
:original_source_id => "NYU01",
|
238
|
-
:source_record_id => "000062856",
|
239
|
-
:institution_code => "NYU",
|
240
|
-
:institution => "NYU",
|
241
|
-
:library_code => "BOBST",
|
242
|
-
:library => "BOBST",
|
243
|
-
:status_code => "check_holdings",
|
244
|
-
:status => "check_holdings",
|
245
|
-
:id_one => "Main Collection",
|
246
|
-
:id_two => "(PR6013.R44 T7 2004 )",
|
247
|
-
:collection => "Main Collection",
|
248
|
-
:call_number => "(PR6013.R44 T7 2004 )",
|
249
|
-
:origin => nil,
|
250
|
-
:display_type => "book",
|
251
|
-
:coverage => [],
|
252
|
-
:notes => "",
|
253
|
-
:url => "#{@base_url}/primo_library/libweb/action/dlDisplay.do?docId=nyu_aleph000062856&institution=NYU&vid=#{@vid}",
|
254
|
-
:request_url => nil,
|
255
|
-
:match_reliability => ServiceResponse::MatchExact,
|
256
|
-
:request_link_supports_ajax_call => false }
|
257
|
-
test_data.each { |key, value|
|
258
|
-
assert_equal(
|
259
|
-
value,
|
260
|
-
holdings.first.view_data[key],
|
261
|
-
"#{key} different than expected.")
|
262
|
-
}
|
263
|
-
end
|
264
|
-
|
265
|
-
def test_primo_service_legacy_settings_minimum
|
266
|
-
request = requests(:primo_id_request)
|
267
|
-
@primo_old_minimum.handle(request)
|
268
|
-
request.referent.referent_values.reset
|
269
|
-
request.dispatched_services.reset
|
270
|
-
request.service_responses.reset
|
271
|
-
test_data = {
|
272
|
-
"aulast" => "Greene",
|
273
|
-
"aufirst" => "Graham,",
|
274
|
-
"au" => "Greene, Graham, 1904-1991",
|
275
|
-
"title" => "Travels with my aunt",
|
276
|
-
"btitle" => "Travels with my aunt",
|
277
|
-
"place" => "New York",
|
278
|
-
"pub" => "Penguin Books",
|
279
|
-
"oclcnum" => "56781200",
|
280
|
-
"lccn" => "2004559272"
|
281
|
-
}
|
282
|
-
test_data.each { |key, value|
|
283
|
-
assert_equal(
|
284
|
-
value,
|
285
|
-
request.referent.metadata[key],
|
286
|
-
"#{key} different than expected.")
|
287
|
-
}
|
288
|
-
holdings = request.get_service_type('holding')
|
289
|
-
assert_equal(
|
290
|
-
1, holdings.length)
|
291
|
-
test_data = {
|
292
|
-
:record_id => "nyu_aleph000062856",
|
293
|
-
:source_id => "nyu_aleph",
|
294
|
-
:original_source_id => "NYU01",
|
295
|
-
:source_record_id => "000062856",
|
296
|
-
:institution_code => "NYU",
|
297
|
-
:institution => "NYU",
|
298
|
-
:library_code => "BOBST",
|
299
|
-
:library => "NYU Bobst",
|
300
|
-
:status_code => "check_holdings",
|
301
|
-
:status => "Check Availability",
|
302
|
-
:id_one => "Main Collection",
|
303
|
-
:id_two => "(PR6013.R44 T7 2004 )",
|
304
|
-
:collection => "Main Collection",
|
305
|
-
:call_number => "(PR6013.R44 T7 2004 )",
|
306
|
-
:origin => nil,
|
307
|
-
:display_type => "book",
|
308
|
-
:coverage => [],
|
309
|
-
:notes => "",
|
310
|
-
:url => "#{@base_url}/primo_library/libweb/action/dlDisplay.do?docId=nyu_aleph000062856&institution=NYU&vid=#{@vid}",
|
311
|
-
:request_url => nil,
|
312
|
-
:match_reliability => ServiceResponse::MatchExact,
|
313
|
-
:request_link_supports_ajax_call => false }
|
314
|
-
test_data.each { |key, value|
|
315
|
-
assert_equal(
|
316
|
-
value,
|
317
|
-
holdings.first.view_data[key],
|
318
|
-
"#{key} different than expected.")
|
319
|
-
}
|
320
946
|
end
|
321
|
-
|
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
|
942
947
|
end
|