Koha/t/db_dependent/lib/KohaTest/ImportBatch/GetImportBatch.pm
Srdjan 12ff7355bb bug_7613: OCLC Connexion gateway
svc/import_bib:
* takes POST request with parameters in url and MARC XML as DATA
* pushes MARC XML to an impoort bach queue of type 'webservice'
* returns status and imported record XML
* is a drop-in replacement for svc/new_bib

misc/cronjobs/import_webservice_batch.pl:
* a cron job for processing impoort bach queues of type 'webservice'
* batches can also be processed through the UI

misc/bin/connexion_import_daemon.pl:
* a daemon that listens for OCLC Connexion requests and is compliant
  with OCLC Gateway spec
* takes request with MARC XML
* takes import batch params from a config file and forwards the lot to
  svc/import_bib
* returns status

ImportBatches:
* Added new import batch type of 'webservice'
* Changed interface to AddImportBatch() - now it takes a hashref
* Replaced batch_type = 'batch' with
  batch_type IN ( 'batch', 'webservice' ) in some SELECTs

Signed-off-by: MJ Ray <mjr@phonecoop.coop>
2012-04-06 17:26:20 +02:00

39 lines
868 B
Perl

package KohaTest::ImportBatch::getImportBatch;
use base qw( KohaTest::ImportBatch );
use strict;
use warnings;
use Test::More;
use C4::ImportBatch;
use C4::Matcher;
use C4::Biblio;
=head3 add_one_and_find_it
=cut
sub add_one_and_find_it : Test( 7 ) {
my $self = shift;
my $batch = {
overlay_action => 'create_new',
import_status => 'staging',
batch_type => 'batch',
file_name => 'foo',
comments => 'inserted during automated testing',
};
my $batch_id = AddImportBatch($batch);
ok( $batch_id, "successfully inserted batch: $batch_id" );
my $retrieved = GetImportBatch( $batch_id );
foreach my $key ( keys %$batch ) {
is( $retrieved->{$key}, $batch->{$key}, "both objects agree on $key" );
}
is( $retrieved->{'import_batch_id'}, $batch_id, 'batch_id' );
}
1;