|
Lines 81-118
foreach my $index ( 0 .. NUMBER_OF_MARC_RECORDS - 1 ) {
Link Here
|
| 81 |
$record = GetMarcBiblio($biblionumber); |
81 |
$record = GetMarcBiblio($biblionumber); |
| 82 |
$record = XMLin($record->as_xml_record); |
82 |
$record = XMLin($record->as_xml_record); |
| 83 |
push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" }; |
83 |
push @header, { datestamp => $timestamp, identifier => "TEST:$biblionumber" }; |
| 84 |
delete $record->{$_} for (('xmlns','xmlns:xsi','xsi:schemaLocation')); |
|
|
| 85 |
push @oaidc, { |
84 |
push @oaidc, { |
| 86 |
header => $header[$index], |
85 |
header => $header[$index], |
| 87 |
metadata => { |
86 |
metadata => { |
| 88 |
'oai_dc:dcCollection' => { |
87 |
'oai_dc:dc' => { |
| 89 |
'oai_dc:dc' => { |
88 |
'dc:title' => "Title $index", |
| 90 |
'dc:title' => { |
89 |
'dc:language' => {}, |
| 91 |
'content' => "Title $index", |
90 |
'dc:type' => {}, |
| 92 |
'xmlns:dc' => 'http://purl.org/dc/elements/1.1/' |
91 |
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', |
| 93 |
}, |
92 |
'xmlns:oai_dc' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', |
| 94 |
'dc:language' => { |
93 |
'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', |
| 95 |
'xmlns:dc' => 'http://purl.org/dc/elements/1.1/' |
94 |
'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd', |
| 96 |
}, |
|
|
| 97 |
'dc:type' => { |
| 98 |
'xmlns:dc' => 'http://purl.org/dc/elements/1.1/' |
| 99 |
}, |
| 100 |
}, |
| 101 |
"xmlns:oai_dc" => "http://www.openarchives.org/OAI/2.0/oai_dc/", |
| 102 |
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", |
| 103 |
"xsi:schemaLocation" => "http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd", |
| 104 |
}, |
95 |
}, |
| 105 |
}, |
96 |
}, |
| 106 |
}; |
97 |
}; |
| 107 |
push @marcxml, { |
98 |
push @marcxml, { |
| 108 |
header => $header[$index], |
99 |
header => $header[$index], |
| 109 |
metadata => { |
100 |
metadata => { |
| 110 |
collection => { |
101 |
record => $record, |
| 111 |
record => $record, |
|
|
| 112 |
"xmlns" => "http://www.loc.gov/MARC21/slim", |
| 113 |
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", |
| 114 |
"xsi:schemaLocation" => "http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd", |
| 115 |
}, |
| 116 |
}, |
102 |
}, |
| 117 |
}; |
103 |
}; |
| 118 |
} |
104 |
} |
|
Lines 136-145
sub test_query {
Link Here
|
| 136 |
my %full_expected = ( |
122 |
my %full_expected = ( |
| 137 |
%$expected, |
123 |
%$expected, |
| 138 |
( |
124 |
( |
| 139 |
request => 'http://localhost', |
125 |
request => 'http://localhost', |
| 140 |
responseDate => DateTime->now . 'Z', |
126 |
responseDate => DateTime->now . 'Z', |
| 141 |
xmlns => 'http://www.openarchives.org/OAI/2.0/', |
127 |
xmlns => 'http://www.openarchives.org/OAI/2.0/', |
| 142 |
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', |
128 |
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', |
| 143 |
'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd', |
129 |
'xsi:schemaLocation' => 'http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd', |
| 144 |
) |
130 |
) |
| 145 |
); |
131 |
); |
|
Lines 221-227
test_query(
Link Here
|
| 221 |
cursor => 6, |
207 |
cursor => 6, |
| 222 |
}, |
208 |
}, |
| 223 |
}, |
209 |
}, |
| 224 |
|
|
|
| 225 |
}, |
210 |
}, |
| 226 |
); |
211 |
); |
| 227 |
|
212 |
|
|
Lines 236-242
test_query(
Link Here
|
| 236 |
cursor => 9, |
221 |
cursor => 9, |
| 237 |
}, |
222 |
}, |
| 238 |
}, |
223 |
}, |
| 239 |
|
|
|
| 240 |
}, |
224 |
}, |
| 241 |
); |
225 |
); |
| 242 |
|
226 |
|
|
Lines 247-253
test_query(
Link Here
|
| 247 |
ListIdentifiers => { |
231 |
ListIdentifiers => { |
| 248 |
header => $header[9], |
232 |
header => $header[9], |
| 249 |
}, |
233 |
}, |
| 250 |
|
|
|
| 251 |
}, |
234 |
}, |
| 252 |
); |
235 |
); |
| 253 |
|
236 |
|
| 254 |
- |
|
|