3 ## Bioperl Test Harness Script for Modules
10 test_begin(-tests => 13,
11 -requires_networking => 1);
12 use_ok('Bio::Tools::Run::AnalysisFactory');
16 # setup global objects that are to be used in more than one test
17 # Also test they were initialised correctly
18 # test new with default access
19 my $factory = Bio::Tools::Run::AnalysisFactory->new();
20 isa_ok( $factory, 'Bio::Tools::Run::AnalysisFactory');
22 # test new with explicit access
23 $factory = Bio::Tools::Run::AnalysisFactory->new(-access=>'soap');
24 isa_ok( $factory, 'Bio::Tools::Run::AnalysisFactory');
26 # test new with non-existing access
27 throws_ok { Bio::Tools::Run::AnalysisFactory->new(-access=>'non_existing') } qr/cannot be found or loaded/, 'Non existant access method threw an error';
29 # test default factory values
31 # Now onto the nitty gritty tests of the modules methods
33 test_skip(-tests => 9, -requires_module => 'SOAP::Lite');
36 my $array_ref = $factory->available_categories;
37 isa_ok( $array_ref, 'ARRAY' );
38 ok( grep(/protein/i, @$array_ref), 'available_categories returned category with protein' );
40 $array_ref = $factory->available_analyses;
41 isa_ok( $array_ref, 'ARRAY' );
42 ok( grep(/seqret/i, @$array_ref), 'available_analyses returned category with seqret' );
44 $array_ref = $factory->available_analyses('edit');
45 isa_ok( $array_ref, 'ARRAY' );
46 ok( grep(/seqret/i, @$array_ref), 'available_analyses("edit") returned something' );
49 lives_ok {$service = $factory->create_analysis('edit.seqret')};
50 skip ("create_analysis failed :$@", 1) if $@;
51 isa_ok( $service, 'Bio::Tools::Run::Analysis::soap' );