3 ## Bioperl Test Harness Script for Modules
10 test_begin(-tests => 17,
11 -requires_networking => 1);
12 use_ok('Bio::Tools::Run::Analysis');
17 test_skip(-tests => 15, -requires_module => 'SOAP::Lite');
20 my $seqret = Bio::Tools::Run::Analysis->new(-name=>'edit.seqret');
24 # condition used to skip this block of tests
25 #skip($why, $how_many_in_block);
26 skip("Failed to create the analysis object", 1)
27 unless isa_ok( $seqret, 'Bio::Tools::Run::Analysis::soap');
29 # test seqret service with some testing data
30 # TODO: use BIOPERLDEBUG to skip these tests
32 'sequence_direct_data' => $seq,
35 is( $seqret->analysis_name, 'seqret', 'analysis_name returned seqret' );
36 isa_ok( $seqret->analysis_spec, 'HASH');
38 my $input_spec = $seqret->input_spec;
39 isa_ok( $input_spec, 'ARRAY' );
40 ok( @$input_spec > 0, 'input_spec returned an array with something in it' );
41 isa_ok( $input_spec->[0], 'HASH' );
42 my $result_spec = $seqret->result_spec;
43 isa_ok( $result_spec, 'ARRAY' );
44 ok( @$result_spec > 0, 'result_spec returned an array with something in it' );
45 like( $seqret->describe, '/^<\?xml /', 'describe seems to have returned the correct thing' );
46 my $job = $seqret->create_job (\%input);
48 skip("Object not created correctly", 6) unless isa_ok( $job, 'Bio::Tools::Run::Analysis::Job' );
50 is( $job->status, 'CREATED', 'Job status correct' );
51 # TODO: not goot to use private methods
52 my $cloned_job = $seqret->create_job ($job->{'_id'});
55 skip( "Couldn't clone the job", 2 )
56 unless isa_ok( $cloned_job, 'Bio::Tools::Run::Analysis::Job',
57 'Job cloned successfully' );
59 like( $cloned_job->last_event, '/^<\?xml /',
60 'last_event seems to have returned the correct thing' );
62 # TODO: not good to use private methods
63 is( $cloned_job->{'_destroy_on_exit'}, 1,
64 'Cloned job removed successfully' );