Supply TEMPLATE and SUFFIX for temporary query sequence files.
[bioperl-run.git] / t / AnalysisFactory_soap.t
blob64f94ea1fe30888298f390d282e58cef9f67a761
1 # -*-Perl-*-
2 # $id$
3 ## Bioperl Test Harness Script for Modules
5 use strict;
7 BEGIN {
8     use Bio::Root::Test;
10     # The EMBL-EBI Soaplab server has been decommissioned on 1st February 2013
11     # (https://www.ebi.ac.uk/Tools/webservices/about/news).
12     # Website "http://www.ebi.ac.uk/soaplab/services" dont exists anymore,
13     # so tests will fail with "404 Not Found" if executed
14     test_begin(-tests => 0,
15                            -requires_networking => 1);
16     use_ok('Bio::Tools::Run::AnalysisFactory');
20 # setup global objects that are to be used in more than one test
21 # Also test they were initialised correctly
22 # test new with default access
23 my $factory = Bio::Tools::Run::AnalysisFactory->new();
24 isa_ok( $factory, 'Bio::Tools::Run::AnalysisFactory');
26 # test new with explicit access
27 $factory = Bio::Tools::Run::AnalysisFactory->new(-access=>'soap');
28 isa_ok( $factory, 'Bio::Tools::Run::AnalysisFactory');
30 # test new with non-existing access
31 throws_ok { Bio::Tools::Run::AnalysisFactory->new(-access=>'non_existing') } qr/cannot be found or loaded/, 'Non existant access method threw an error';
33 # test default factory values
35 # Now onto the nitty gritty tests of the modules methods
36 SKIP: {
37     test_skip(-tests => 9, -requires_module => 'SOAP::Lite');
38         use_ok('SOAP::Lite');
39         
40         my $array_ref = $factory->available_categories;
41         isa_ok( $array_ref, 'ARRAY' );
42         ok( grep(/protein/i, @$array_ref), 'available_categories returned category with protein' );
43         
44         $array_ref = $factory->available_analyses;
45         isa_ok( $array_ref, 'ARRAY' );
46         ok( grep(/seqret/i, @$array_ref), 'available_analyses returned category with seqret' );
47         
48         $array_ref = $factory->available_analyses('edit');
49         isa_ok( $array_ref, 'ARRAY' );
50         ok( grep(/seqret/i, @$array_ref), 'available_analyses("edit") returned something' );
51         
52         my $service;
53         lives_ok {$service = $factory->create_analysis('edit.seqret')};
54         skip ("create_analysis failed :$@", 1) if $@;
55         isa_ok( $service, 'Bio::Tools::Run::Analysis::soap' );