[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Tue Nov 22 20:05:01 UTC 2005
mwilkinson
Tue Nov 22 15:05:01 EST 2005
Update of /home/repository/moby/moby-live/Perl/t
In directory pub.open-bio.org:/tmp/cvs-serv13959/t
Modified Files:
Client-Central.t Client-Service.t
Log Message:
modified the test suite so that it connects to whatever MOBY Central is set as the default in the environment. The test suite will function on a registry that is empty *except for the bootstrap object ontology*. It also works under Windows using nmake test.
moby-live/Perl/t Client-Central.t,1.43,1.44 Client-Service.t,1.7,1.8
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/11/20 16:05:05 1.43
+++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/11/22 20:05:00 1.44
@@ -14,9 +14,36 @@
use Test::More 'no_plan'; #skip_all => "Turn off for development"; # See perldoc Test::More for details
use strict;
use Data::Dumper;
+
+print STDERR <<END;
+
+
+
+ This is the MOBY Client Central test suite.
+
+ by default this connects to the server at mobycentral.icapture.ubc.ca
+ (or whatever the default server is set to in the code)
+
+ If you want to test a different server you must set the following
+ ENVIRONEMNT VARABLES:
+
+ MOBY_SERVER='http://your.server.name/path/to/mobycentral.pl'
+ MOBY_URI='http://your.server.name/MOBY/Central'
+
+
+END
+
+#$ENV{MOBY_SERVER} = 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl'
+#unless ($ENV{MOBY_SERVER}) print;
+#$ENV{MOBY_URI} = 'http://mobycentral.icapture.ubc.ca/MOBY/Central'
+#unless ($ENV{MOBY_URI});
+
+
+
#Is the client-code even installed?
BEGIN { use_ok('MOBY::Client::Central') };
-
+
+
END {
# Define cleanup of registry, to return it to its 'pristine' state,
# so that later attempts to run tests don't run into problems caused
@@ -24,12 +51,7 @@
# Reconnect to MOBY Central here, since other connections
# will have gone out of scope by the time we get to this END block.
# Also can't use %Obj,
- my $C = MOBY::Client::Central->new(
- Registries => { # URL/URI should be specific, not just "localhost"
- mobycentral => { URL => 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl',
- URI => 'http://mobycentral.icapture.ubc.ca/MOBY/Central'}
- }
- );
+ my $C = MOBY::Client::Central->new();
my $r = $C->deregisterObjectClass( objectType => "Rubbish" );
$r = $C->deregisterService( serviceName => 'myfirstservice',
authURI => 'test.suite.com' );
@@ -46,15 +68,19 @@
};
# Can we connect to the registry?
-my $C = MOBY::Client::Central->new(
- Registries => { # URL/URI should be specific, not just "localhost"
- mobycentral => { URL => 'http://mobycentral.icapture.ubc.ca/cgi-bin/MOBY05/mobycentral.pl',
- URI => 'http://mobycentral.icapture.ubc.ca/MOBY/Central'}
- }
- );
+my $C = MOBY::Client::Central->new();
isa_ok( $C, 'MOBY::Client::Central',"Connected to test MOBY Central")
or die("Cannot Connect to MOBY Central... cannot continue?");
+print STDERR <<END;
+
+
+ For the following tests I will be using the server at:
+END
+
+print STDERR "\t",$C->Registries->{mobycentral}->{URL},"\n\n\n";
+
+
############ ENFORCE REGISTRY API ###############
# First, mandatory methods for all registries.
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Client-Service.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/11/20 16:15:30 1.7
+++ /home/repository/moby/moby-live/Perl/t/Client-Service.t 2005/11/22 20:05:00 1.8
@@ -22,7 +22,15 @@
BEGIN { use_ok('MOBY::Client::Service') };
END {
- # Clean up after yourself, in case tests fail, or the interpreter is interrupted partway though...
+ # Define cleanup of registry, to return it to its 'pristine' state,
+ # so that later attempts to run tests don't run into problems caused
+ # by failure of these tests, or abortion of the test script.
+ # Reconnect to MOBY Central here, since other connections
+ # will have gone out of scope by the time we get to this END block.
+ # Also can't use %Obj,
+ my $C = MOBY::Client::Central->new();
+ my $r = $C->deregisterService( serviceName => 'myfirstservice',
+ authURI => 'test.suite.com' );
};
@@ -34,8 +42,25 @@
# Find a service at MOBY Central, try to create a local instance.
my $C = MOBY::Client::Central->new();
-my ($s, $r) = $C->findService( authURI => 'bioinfo.icapture.ubc.ca',
- name => 'getDragonLocusAlleles' );
+my %RegSmpl = ( serviceName => "myfirstservice",
+ serviceType => "Retrieval",
+ authURI => "test.suite.com",
+ contactEmail => 'your at mail.address',
+ description => "this is my first service",
+ category => "moby",
+ URL => "http://illuminae/cgi-bin/service.pl",
+ input => [
+ ['articleName1', [Object => []]], # Simple
+ ],
+ output => [
+ ['articleName2', [String => []]], # Simple
+ ],
+ );
+
+# Service name can't start with numeric
+my $r = $C->registerService( %RegSmpl );
+my ($s, $err) = $C->findService( authURI => 'test.suite.com',
+ name => 'myfirstservice' );
ok($s) or diag("Couldn't retrieve service details from MOBY Central");
ok($$s[0]) or diag("no service instance found for getDragonLocusAlleles");
my $wsdl = $C->retrieveService($$s[0]);
More information about the MOBY-guts
mailing list