umlaut 3.0.0alpha9 → 3.0.0alpha10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/app/controllers/umlaut_controller.rb +5 -0
  2. data/app/models/collection.rb +90 -54
  3. data/app/models/referent.rb +30 -17
  4. data/app/models/service_wave.rb +59 -41
  5. data/lib/exlibris/primo/holding.rb +3 -9
  6. data/lib/exlibris/primo/related_link.rb +17 -0
  7. data/lib/exlibris/primo/searcher.rb +52 -31
  8. data/lib/exlibris/primo/source/distribution/nyu_aleph.rb +59 -38
  9. data/lib/exlibris/primo_ws.rb +1 -1
  10. data/lib/service.rb +1 -1
  11. data/lib/service_adaptors/primo_service.rb +38 -5
  12. data/lib/service_adaptors/primo_source.rb +2 -2
  13. data/lib/service_adaptors/sfx.rb +11 -0
  14. data/lib/term_color.rb +9 -2
  15. data/lib/umlaut/version.rb +1 -1
  16. data/lib/umlaut_configurable.rb +9 -0
  17. data/test/dummy/config/umlaut_services.yml +20 -0
  18. data/test/dummy/tmp/cache/assets/CDC/680/sprockets%2F2b68ef632d12610f3c9563168bfa7c05 +0 -0
  19. data/test/dummy/tmp/cache/assets/CF5/9B0/sprockets%2F7933bfe880731b396791f1682ce3f7fa +0 -0
  20. data/test/dummy/tmp/cache/assets/CFB/2F0/sprockets%2F62d51f0aa5cac4b1cf7091823772a604 +0 -0
  21. data/test/dummy/tmp/cache/assets/D4C/0A0/sprockets%2F7810d837eec3ac57ad78756af83a6a55 +0 -0
  22. data/test/dummy/tmp/cache/assets/D4C/E30/sprockets%2F631abf89746799b7a5b2b3b4f6294bcd +0 -0
  23. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  24. data/test/dummy/tmp/cache/assets/D6C/7D0/sprockets%2F8a05d6981ec0d38c51739bef0b3a9c2b +0 -0
  25. data/test/dummy/tmp/cache/assets/D70/080/sprockets%2F24d3ce40ae5cc827a9183b1fb837e84e +0 -0
  26. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  27. data/test/dummy/tmp/cache/assets/E5F/960/sprockets%2Fdc007b6cad5c7ef08e33ec28cfff0ef6 +0 -0
  28. data/test/unit/aleph_patron_test.rb +6 -6
  29. data/test/unit/aleph_record_benchmarks.rb +1 -1
  30. data/test/unit/aleph_record_test.rb +4 -4
  31. data/test/unit/primo_searcher_test.rb +90 -82
  32. data/test/unit/primo_service_test.rb +683 -680
  33. data/test/unit/primo_ws_test.rb +45 -32
  34. metadata +135 -155
  35. data/lib/tasks/#Untitled-1# +0 -1843
  36. data/test/dummy/out +0 -5
@@ -1,6 +1,4 @@
1
- require 'nokogiri'
2
-
3
- module Exlibris::Primo::Source::Local
1
+ module Exlibris::Primo::Source
4
2
  # == Overview
5
3
  # NYUAleph is an Exlibris::Primo::Source::Aleph that expands Primo availlibrary
6
4
  # elements based on of Aleph items return from the Aleph REST APIs.
@@ -96,35 +94,7 @@ module Exlibris::Primo::Source::Local
96
94
  ) unless @aleph_helper.nil? or @aleph_item_adm_library.nil?
97
95
  @id_one = aleph_collection unless aleph_collection.nil?
98
96
  # Set status and status code.
99
- aleph_status_code, aleph_status = nil, nil
100
- # Loop through source config for statuses
101
- aleph_config["statuses"].each { |aleph_config_status_code, aleph_config_status|
102
- # Set checked out as Aleph status and code
103
- aleph_status_code = aleph_config_status_code and
104
- aleph_status = "Due: " + @aleph_item_circulation_status and
105
- break if (aleph_config_status_code == "checked_out" and
106
- aleph_config_status === @aleph_item_circulation_status)
107
- # Set circulation statuses like On Shelf, Billed as Lost, as Aleph status and code
108
- aleph_status_code = aleph_config_status_code and
109
- break if (aleph_config_status.instance_of?(Array) and
110
- aleph_config_status.include?(@aleph_item_circulation_status))
111
- } unless aleph_config.nil? or aleph_config["statuses"].nil?
112
- if (aleph_status_code.nil?)
113
- # Set Aleph web text as Aleph status if we haven't already gotten the Aleph status
114
- aleph_status = @aleph_helper.item_web_text(
115
- :adm_library_code => @aleph_item_adm_library.downcase,
116
- :sub_library_code => @aleph_item_sub_library_code,
117
- :item_status_code => @aleph_item_status_code,
118
- :item_process_status_code => @aleph_item_process_status_code
119
- ) unless @aleph_helper.nil? or @aleph_item_adm_library.nil?
120
- # Set code as "overridden_by_nyu_aleph"
121
- aleph_status_code = "overridden_by_nyu_aleph" unless aleph_status.nil?
122
- end
123
- # Set status code if we have it.
124
- @status_code = aleph_status_code unless aleph_status_code.nil?
125
- # Set status.
126
- @status = (aleph_status.nil?) ?
127
- decode(:status, {:address => "statuses"}, true) : aleph_status
97
+ @status_code, @status = get_status
128
98
  # Aleph doesn't work right so we have to push the patron to the Aleph holdings page!
129
99
  @request_url = url if requestable?
130
100
  # We're through a second time, so we should be alright to
@@ -171,7 +141,43 @@ module Exlibris::Primo::Source::Local
171
141
  return source_data
172
142
  end
173
143
 
174
- def get_coverage(aleph_record)
144
+ def get_status
145
+ # Initialize status and status code.
146
+ aleph_status_code, aleph_status = nil, nil
147
+ # Loop through source config for statuses
148
+ aleph_config["statuses"].each { |aleph_config_status_code, aleph_config_status|
149
+ # Set checked out as Aleph status and code
150
+ aleph_status_code = aleph_config_status_code and
151
+ aleph_status = "Due: " + @aleph_item_circulation_status and
152
+ break if (aleph_config_status_code == "checked_out" and
153
+ aleph_config_status === @aleph_item_circulation_status)
154
+ # Set circulation statuses like On Shelf, Billed as Lost, as Aleph status and code
155
+ aleph_status_code = aleph_config_status_code and
156
+ break if (aleph_config_status.instance_of?(Array) and
157
+ aleph_config_status.include?(@aleph_item_circulation_status))
158
+ } unless aleph_config.nil? or aleph_config["statuses"].nil?
159
+ deferred_statuses = (aleph_config["deferred_statuses"].nil?) ? {} : aleph_config["deferred_statuses"]
160
+ if (aleph_status_code.nil? or deferred_statuses.include?(aleph_status_code))
161
+ # Set Aleph web text as Aleph status if we haven't already gotten the Aleph status
162
+ aleph_status = @aleph_helper.item_web_text(
163
+ :adm_library_code => @aleph_item_adm_library.downcase,
164
+ :sub_library_code => @aleph_item_sub_library_code,
165
+ :item_status_code => @aleph_item_status_code,
166
+ :item_process_status_code => @aleph_item_process_status_code
167
+ ) unless @aleph_helper.nil? or @aleph_item_adm_library.nil?
168
+ # Set code as "overridden_by_nyu_aleph"
169
+ aleph_status_code = "overridden_by_nyu_aleph" unless aleph_status.nil?
170
+ end
171
+ # Set status code if we have it.
172
+ status_code = aleph_status_code unless aleph_status_code.nil?
173
+ # Set status.
174
+ status = (aleph_status.nil?) ?
175
+ decode(:status, {:address => "statuses"}, true) : aleph_status
176
+ return status_code, status
177
+ end
178
+
179
+ def get_coverage(aleph_record)
180
+ require 'nokogiri'
175
181
  locations_seen = []
176
182
  coverage = []
177
183
  return coverage unless display_type.upcase == "JOURNAL"
@@ -180,7 +186,7 @@ module Exlibris::Primo::Source::Local
180
186
  raise "Error getting bib from Aleph REST APIs. #{aleph_record.error}" unless aleph_record.error.nil?
181
187
  # Parse and process bib XML
182
188
  # First look at bib 866 and record sub_library and collection (through aleph config mappings)
183
- Nokogiri::XML(aleph_bib).search("//datafield[@tag='866']") do |bib_866|
189
+ Nokogiri::XML(aleph_bib).search("//datafield[@tag='866']").each do |bib_866|
184
190
  bib_866_l = bib_866.at(
185
191
  "subfield[@code='l']"
186
192
  ).inner_text unless bib_866.at("subfield[@code='l']").nil?
@@ -203,9 +209,20 @@ module Exlibris::Primo::Source::Local
203
209
  :sub_library_code => bib_866_sub_library_code,
204
210
  :collection_code => bib_866_collection_code
205
211
  ) unless @aleph_helper.nil? or bib_866_adm_library.nil?
206
- coverage.push(
207
- "Available in #{bib_866_collection}: #{build_coverage_string(bib_866_j, bib_866_k)}".strip
208
- ) unless bib_866_collection.nil? or bib_866_j.nil? and bib_866_k.nil?
212
+ unless bib_866_collection.nil?
213
+ unless bib_866_j.nil? and bib_866_k.nil?
214
+ coverage.push(
215
+ "Available in #{bib_866_collection}: #{build_coverage_string(bib_866_j, bib_866_k)}".strip
216
+ )
217
+ else
218
+ bib_866_i = bib_866.at(
219
+ "subfield[@code='i']"
220
+ ).inner_text unless bib_866.at("subfield[@code='i']").nil?
221
+ coverage.push(
222
+ "#{bib_866_i}".strip
223
+ ) unless bib_866_i.nil?
224
+ end
225
+ end
209
226
  locations_seen.push({
210
227
  :adm_library => bib_866_adm_library,
211
228
  :sub_library_code => bib_866_sub_library_code })
@@ -216,7 +233,7 @@ module Exlibris::Primo::Source::Local
216
233
  # Parse and process holding XML
217
234
  # Now look at holding 866 and record sub_library and collection
218
235
  # to see if there is anything we missed
219
- Nokogiri::XML(aleph_holdings).search("//holding") do |aleph_holding|
236
+ Nokogiri::XML(aleph_holdings).search("//holding").each do |aleph_holding|
220
237
  holding_sub_library_code = aleph_holding.at(
221
238
  "//datafield[@tag='852']/subfield[@code='b']"
222
239
  ).inner_text unless aleph_holding.at("//datafield[@tag='852']/subfield[@code='b']").nil?
@@ -230,6 +247,10 @@ module Exlibris::Primo::Source::Local
230
247
  next if locations_seen.include?({
231
248
  :adm_library => holding_adm_library,
232
249
  :sub_library_code => holding_sub_library_code })
250
+ holding_852_z = aleph_holding.at(
251
+ "//datafield[@tag='852']/subfield[@code='z']"
252
+ ).inner_text unless aleph_holding.at("//datafield[@tag='852']/subfield[@code='z']").nil?
253
+ coverage.push("Note: #{holding_852_z}") unless holding_852_z.nil?
233
254
  holding_collection = @aleph_helper.collection_text(
234
255
  :adm_library_code => holding_adm_library.downcase,
235
256
  :sub_library_code => holding_sub_library_code,
@@ -1,7 +1,7 @@
1
1
  # Module for calling Primo Web Services
2
2
  # Please note the following:
3
3
  # * Be sure to configure the Primo Back Office with the relevant IPs to enable interaction via the Web Services
4
- # * This module does not parse the response but instead stores it as an Hpricot::Doc for the calling classes to parse
4
+ # * This module does not parse the response but instead stores it as an Nokogiri::XML::Document for the calling classes to parse
5
5
  module Exlibris::PrimoWS
6
6
  require 'nokogiri'
7
7
 
data/lib/service.rb CHANGED
@@ -67,7 +67,7 @@ class Service
67
67
  # handle both cases.
68
68
  raise NameError if value.nil?
69
69
  rescue NameError
70
- raise ArgumentError.new("Missing Service configuration parameter. Service type #{self.class} (id: #{self.id}) requires a config parameter named '#{param}'. Check your config/umlaut_config/services.yml file.")
70
+ raise ArgumentError.new("Missing Service configuration parameter. Service type #{self.class} (id: #{self.service_id}) requires a config parameter named '#{param}'. Check your config/umlaut_config/services.yml file.")
71
71
  end
72
72
  end
73
73
  end
@@ -24,6 +24,7 @@
24
24
  # * table_of_contents - parsed from links/linktotoc elements in the PNX record
25
25
  # * referent_enhance - metadata parsed from the addata section of the PNX record when the record was found by Primo id
26
26
  # * cover_image - parsed from first addata/lad02 element in the PNX record
27
+ # * highlighted_link - parsed from links/addlink elements in the PNX record
27
28
  #
28
29
  # ==Available Parameters
29
30
  # Several configurations parameters are available to be set in services.yml, e.g.
@@ -44,6 +45,7 @@
44
45
  # - table_of_contents
45
46
  # - referent_enhance
46
47
  # - cover_image
48
+ # - highlighted_link
47
49
  # base_url:: _required_ host and port of Primo server; used for Primo web services, deep links and holding_search
48
50
  # base_path:: *DEPRECATED* previous name of base_url
49
51
  # vid:: _required_ view id for Primo deep links and holding_search.
@@ -127,6 +129,7 @@ class PrimoService < Service
127
129
  @holding_attributes = Exlibris::Primo::Holding.base_attributes
128
130
  @rsrc_attributes = Exlibris::Primo::Rsrc.base_attributes
129
131
  @toc_attributes = Exlibris::Primo::Toc.base_attributes
132
+ @related_link_attributes = Exlibris::Primo::RelatedLink.base_attributes
130
133
  # TODO: Run these decisions by Bill M. to see if they make sense.
131
134
  @referent_enhancements = {
132
135
  # Prefer SFX journal titles to Primo journal titles
@@ -143,6 +146,7 @@ class PrimoService < Service
143
146
  }
144
147
  @suppress_urls = []
145
148
  @suppress_tocs = []
149
+ @suppress_related_links = []
146
150
  @suppress_holdings = []
147
151
  @service_types = [ "fulltext", "holding", "holding_search",
148
152
  "table_of_contents", "referent_enhance", "cover_image" ] if @service_types.nil?
@@ -164,7 +168,7 @@ class PrimoService < Service
164
168
  # Set holding_search_institution to vid and print warning in the logs.
165
169
  if @service_types.include?("holding_search") and @holding_search_institution.nil?
166
170
  @holding_search_institution = @institution
167
- RAILS_DEFAULT_LOGGER.warn("Required parameter 'holding_search_institution' was not set. Please set the appropriate value in services.yml. Defaulting institution to view id, #{@vid}.")
171
+ Rails.logger.warn("Required parameter 'holding_search_institution' was not set. Please set the appropriate value in services.yml. Defaulting institution to view id, #{@vid}.")
168
172
  end # End backward compatibility maintenance
169
173
  raise ArgumentError.new(
170
174
  "Missing Service configuration parameter. Service type #{self.class} (id: #{self.id}) requires a config parameter named 'holding_search_institution'. Check your config/umlaut_config/services.yml file."
@@ -211,7 +215,7 @@ class PrimoService < Service
211
215
  Rails.logger.error(
212
216
  "Error in Exlibris::Primo::Searcher. "+
213
217
  "Returning 0 Primo services for search #{search_params.inspect}. "+
214
- "Exlibris::Primo::Searcher raised the following exception:\n#{e}")
218
+ "Exlibris::Primo::Searcher raised the following exception:\n#{e}\n#{e.backtrace.inspect}")
215
219
  return request.dispatched(self, true)
216
220
  end
217
221
  # Enhance the referent with metadata from Primo Searcher if primo id is present
@@ -226,7 +230,9 @@ class PrimoService < Service
226
230
  end
227
231
  end
228
232
  # Get cover image only if primo_id is defined
229
- if primo_id and @service_types.include?("referent_enhance")
233
+ # TODO: make cover image service smarter and only
234
+ # include things that are actually URLs.
235
+ if primo_id and @service_types.include?("cover_image")
230
236
  cover_image = primo_searcher.cover_image
231
237
  unless cover_image.nil?
232
238
  request.add_service_response(
@@ -344,6 +350,33 @@ class PrimoService < Service
344
350
  )
345
351
  end
346
352
  end
353
+ if @service_types.include?("highlighted_link")
354
+ # Let's find any related links, and add highlighted link responses for those.
355
+ related_links_seen = [] # for de-duplicating urls from catalog.
356
+ primo_searcher.related_links.each do |related_link|
357
+ url = related_link.url # actual url
358
+ next if related_links_seen.include?(related_link.url)
359
+ # We have our own list of URLs to suppress, array of strings
360
+ # or regexps.
361
+ next if @suppress_related_links.find {|suppress| suppress === related_link.url}
362
+ # No url? Forget it.
363
+ next if related_link.url.nil?
364
+ related_links_seen.push(related_link.url)
365
+ service_data = {}
366
+ @related_link_attributes.each do |attr|
367
+ service_data[attr] = related_link.method(attr).call
368
+ end
369
+ # Default display text to URL.
370
+ service_data[:display_text] = (service_data[:display].nil?) ? service_data[:url] : service_data[:display]
371
+ # Add the response
372
+ request.add_service_response(
373
+ service_data.merge(
374
+ :service => self,
375
+ :service_type_value => 'highlighted_link'
376
+ )
377
+ )
378
+ end
379
+ end
347
380
  return request.dispatched(self, true)
348
381
  end
349
382
 
@@ -358,8 +391,8 @@ class PrimoService < Service
358
391
 
359
392
  private
360
393
  def primo_config
361
- default_file = "#{Rails.root}/config/umlaut_config/primo.yml"
362
- config_file = @primo_config.nil? ? default_file : "#{Rails.root}/config/umlaut_config/"+ @primo_config
394
+ default_file = "#{Rails.root}/config/primo.yml"
395
+ config_file = @primo_config.nil? ? default_file : "#{Rails.root}/config/"+ @primo_config
363
396
  Rails.logger.warn("Primo config file not found: #{config_file}.") and return {} unless File.exists?(config_file)
364
397
  config_hash = YAML.load_file(config_file)
365
398
  return (config_hash.nil?) ? {} : config_hash
@@ -3,7 +3,7 @@
3
3
  # This mechanism allows linking to original data sources and expanded holdings information
4
4
  # based on those sources and can be implemented per source.
5
5
  # To create a Primo source holding, you first must create a local class representing the source in
6
- # module Exlibris::Primo::Source::Local which extends Exlibris::Primo::Holding.
6
+ # module Exlibris::Primo::Source which extends Exlibris::Primo::Holding.
7
7
  # Two methods are then available for overriding:
8
8
  # :expand - expand holdings that may have been collapsed into a single availlibrary element
9
9
  # in Primo based on information from the source
@@ -24,7 +24,7 @@
24
24
  # ==Examples
25
25
  # Two examples of customized sources are:
26
26
  # * Exlibris::Primo::Source::Aleph
27
- # * Exlibris::Primo::Source::Local::NYUAleph
27
+ # * Exlibris::Primo::Source::NYUAleph
28
28
  class PrimoSource < PrimoService
29
29
 
30
30
  # Overwrites PrimoService#new.
@@ -109,6 +109,17 @@ class Sfx < Service
109
109
  transport = OpenURL::Transport.new(@base_url, nil, :open_timeout => @sfx_timeout, :read_timeout => @sfx_timeout)
110
110
 
111
111
  context_object = request.to_context_object
112
+
113
+ ## SFX HACK WORKAROUND
114
+ # SFX will parse private_data/pid/rft_dat containing ERIC, when sid/rfr_id
115
+ # is CSA. But it only expects an OpenURL 0.1 to do this. We send it a
116
+ # 1.0. To get it to recognize it anyway, we need to send it a blank
117
+ # url_ver/ctx_ver
118
+ if ( context_object.referrer.identifiers.find {|i| i.start_with? "info:sid/CSA"} &&
119
+ context_object.referent.private_data != nil)
120
+ context_object.openurl_ver = ""
121
+ end
122
+
112
123
  transport.add_context_object(context_object)
113
124
  transport.extra_args["sfx.response_type"]="multi_obj_xml"
114
125
 
data/lib/term_color.rb CHANGED
@@ -3,8 +3,15 @@
3
3
 
4
4
  module TermColor
5
5
  mattr_accessor :colorize_logging
6
- self.colorize_logging = Rails.application.config.colorize_logging
7
-
6
+ # is nil in dev in rails 3.2, but supposed to default to true. okay.
7
+ self.colorize_logging = if Rails.application.config.colorize_logging.nil?
8
+ # In Rails 3.2, somehow we can't count on config.colorize_logging being
9
+ # set, okay, as a default colorize in development only.
10
+ Rails.env == "development"
11
+ else
12
+ Rails.application.config.colorize_logging
13
+ end
14
+
8
15
  # Embed in a String to clear all previous ANSI sequences.
9
16
  CLEAR = "\e[0m"
10
17
  BOLD = "\e[1m"
@@ -1,3 +1,3 @@
1
1
  module Umlaut
2
- VERSION = "3.0.0alpha9"
2
+ VERSION = "3.0.0alpha10"
3
3
  end
@@ -72,6 +72,9 @@ module UmlautConfigurable
72
72
  # (see lib/referent_filters )
73
73
  add_referent_filters!( :match => /.*/, :filter => DissertationCatch.new )
74
74
 
75
+
76
+ # Create a permalink short URL for every request?
77
+ create_permalinks true
75
78
 
76
79
  # skip_resolve_menu can be used to control 'direct' linking, skipping
77
80
  # the resolve menu to deliver a full text link or other resource
@@ -206,6 +209,12 @@ module UmlautConfigurable
206
209
  # Output timing of service execution to logs
207
210
  log_service_timing (Rails.env == "development")
208
211
 
212
+ # Execute service wave concurrently with threads?
213
+ # Set to false to execute serially one after the other with
214
+ # no threads instead. At this point, believed only useful
215
+ # for debugging and analysis.
216
+ threaded_service_wave true
217
+
209
218
 
210
219
  #####
211
220
  # Pieces of content on a Resolve page can be declaritively configured.
@@ -27,6 +27,26 @@ default:
27
27
  base_url: YOUR_SFX_BASE_URL
28
28
  priority: 3
29
29
 
30
+ Primo:
31
+ type: PrimoService
32
+ disabled: false
33
+ display_name: Primo
34
+ priority: 3
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 Primo.
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
+
30
50
 
31
51
  # First half of Amazon, run in foreground, get metadata and cover images.
32
52
  Amazon:
@@ -1,7 +1,7 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- class AlephPatronTest < ActiveSupport::TestCase
1
+ require 'test_helper'
2
+ class AlephPatronTest < Test::Unit::TestCase
3
3
  def setup
4
- @primo_config = YAML.load_file("#{Rails.root}/config/umlaut_config/primo.yml")
4
+ @primo_config = YAML.load_file("#{Rails.root}/config/primo.yml")
5
5
  @nyu_aleph_config = @primo_config["sources"]["nyu_aleph"]
6
6
  @rest_url = @nyu_aleph_config["rest_url"]
7
7
  @aleph_doc_library = "NYU01"
@@ -17,9 +17,9 @@ class AlephPatronTest < ActiveSupport::TestCase
17
17
  # Test exception handling for bogus response.
18
18
  def test_bogus_response
19
19
  patron = Exlibris::Aleph::Patron.new(@nyuidn, @bogus_url)
20
- assert_raise(REXML::ParseException) { patron.loans }
21
- assert_raise(REXML::ParseException) { patron.renew_loans() }
22
- assert_raise(REXML::ParseException) { patron.renew_loans(@aleph_renew_item_id) }
20
+ assert_raise(MultiXml::ParseError) { patron.loans }
21
+ assert_raise(MultiXml::ParseError) { patron.renew_loans() }
22
+ assert_raise(MultiXml::ParseError) { patron.renew_loans(@aleph_renew_item_id) }
23
23
  assert_raise(RuntimeError) { patron.place_hold(@aleph_adm_library, @aleph_doc_library, @aleph_doc_number, @aleph_item_id, {:pickup_location => @pickup_location}) }
24
24
  end
25
25
 
@@ -1,5 +1,5 @@
1
1
  require File.dirname(__FILE__) + '/../test_helper'
2
- class AlephRecordBenchMarks < ActiveSupport::TestCase
2
+ class AlephRecordBenchMarks < Test::Unit::TestCase
3
3
  def setup
4
4
  @primo_config = YAML.load_file("#{Rails.root}/config/umlaut_config/primo.yml")
5
5
  @nyu_aleph_config = @primo_config["sources"]["nyu_aleph"]
@@ -1,7 +1,7 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- class AlephRecordTest < ActiveSupport::TestCase
1
+ require 'test_helper'
2
+ class AlephRecordTest < Test::Unit::TestCase
3
3
  def setup
4
- @primo_config = YAML.load_file("#{Rails.root}/config/umlaut_config/primo.yml")
4
+ @primo_config = YAML.load_file("#{Rails.root}/config/primo.yml")
5
5
  @nyu_aleph_config = @primo_config["sources"]["nyu_aleph"]
6
6
  @rest_url = @nyu_aleph_config["rest_url"]
7
7
  @aleph_doc_library = "NYU01"
@@ -14,7 +14,7 @@ class AlephRecordTest < ActiveSupport::TestCase
14
14
  aleph_record = Exlibris::Aleph::Record.new(@aleph_doc_library, @aleph_doc_number, @bogus_url)
15
15
  assert_raise(RuntimeError) { aleph_record.bib }
16
16
  assert_raise(RuntimeError) { aleph_record.holdings }
17
- assert_raise(REXML::ParseException) { aleph_record.items }
17
+ assert_raise(MultiXml::ParseError) { aleph_record.items }
18
18
  end
19
19
 
20
20
  # Test search for a single Primo document.