| 1 | use strictscip-perl cpan Catmandu-OAI 0.21 strict/; |
| 2 | use warningsscip-perl cpan Catmandu-OAI 0.21 warnings/; |
| 3 | use Catmandu::Importer::OAIscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/; |
| 4 | use Test::Morescip-perl cpan Catmandu-OAI 0.21 Test/More/; |
| 5 | |
| 6 | my $importer = Catmandu::Importer::OAI->newscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/new().( |
| 7 | url => 'http://biblio.ugent.be/oai', |
| 8 | set => "allFtxt", |
| 9 | dry => 1, |
| 10 | ); |
| 11 | |
| 12 | my $record = $importer->firstscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/first().; |
| 13 | |
| 14 | okscip-perl cpan Catmandu-OAI 0.21 main/ok(). existsscip-perl cpan Catmandu-OAI 0.21 main/exists(). $record->{url} , 'dry run'; |
| 15 | |
| 16 | # skip live testing by default (mock server instead) |
| 17 | if ($ENVscip-perl cpan Catmandu-OAI 0.21 main/`%ENV`.{RELEASE_TESTING}) { |
| 18 | $importer = Catmandu::Importer::OAI->newscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/new().( |
| 19 | url => 'http://biblio.ugent.be/oai', |
| 20 | set => "allFtxt" |
| 21 | ); |
| 22 | |
| 23 | $record = $importer->firstscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/first().; |
| 24 | |
| 25 | okscip-perl cpan Catmandu-OAI 0.21 main/ok(). $record , 'listrecords'; |
| 26 | |
| 27 | |
| 28 | $importer = Catmandu::Importer::OAI->newscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/new().( |
| 29 | url => 'http://biblio.ugent.be/oai', |
| 30 | set => "allFtxt", |
| 31 | listIdentifiers => 1, |
| 32 | ); |
| 33 | |
| 34 | $record = $importer->firstscip-perl cpan Catmandu-OAI 0.21 Catmandu/Importer/OAI/first().; |
| 35 | |
| 36 | okscip-perl cpan Catmandu-OAI 0.21 main/ok(). $record, 'listidentifiers'; |
| 37 | } |
| 38 | |
| 39 | done_testing; |