[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Mon Jun 23 16:05:17 UTC 2003
mwilkinson
Mon Jun 23 12:05:17 EDT 2003
Update of /home/repository/moby/moby-live/Perl/scripts
In directory pub.open-bio.org:/tmp/cvs-serv4125/scripts
Modified Files:
testMOBYClientCentral_v05.pl
Log Message:
added a findService test to MOBY::Client::Central. It fails at the moment, and I'm not sure why.
moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2003/06/18 16:30:56 1.4
+++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2003/06/23 16:05:17 1.5
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use MOBY::Client::Central;
-sub TEST {
+sub TEST { # test of Registration object
($reg, $test, $expect) = @_;
die "\a\a\aREG OBJECT MALFORMED" unless $reg;
if ($reg->success == $expect){
@@ -10,6 +10,15 @@
print "test $test\t\t[FAIL]\n",$reg->message,"\n\n";
}
}
+sub TEST2 { # test of ServiceInstance object listref
+ ($SI, $test, $expect) = @_;
+ die "\a\a\aREG OBJECT MALFORMED" unless ($SI && (ref($SI) =~ /array/i));
+ if ($SI->[0] == $expect){
+ print "test $test\t\t[PASS]\n";
+ } else {
+ print "test $test\t\t[FAIL]\n";
+ }
+}
my $C = MOBY::Client::Central->new();
@@ -169,52 +178,46 @@
],
), 20, 1);
+
+TEST2($C->findService(
+ serviceName => "myfirstservice2",
+ serviceType => "Retrieval",
+ authURI => "www.illuminae.com",
+ authoritative => 0,
+ category => "moby",
+ input =>[
+ ["Object"], # Simple
+ ]), 21, 1);
+
+
TEST($C->deregisterService(
serviceName => "myfirstservice2",
authURI => "www.illuminae.com",
- ), 21, 1);
+ ), 22, 1);
TEST($C->deregisterService(
serviceName => "myfirstservice2",
authURI => "www.illuminae.com",
- ), 22, 0);
+ ), 23, 0);
TEST($C->deregisterService(
serviceName => "myfirstservice",
authURI => "www.illuminae.com",
- ), 23, 1);
+ ), 24, 1);
-TEST($C->deregisterObjectClass(objectType => "YetMoreCrap"), 24, 1);
-TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 25, 1);
-TEST($C->deregisterNamespace(namespaceType =>'Genbank/GI'), 26, 1);
+TEST($C->deregisterObjectClass(objectType => "YetMoreCrap"), 25, 1);
+TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 26, 1);
+TEST($C->deregisterNamespace(namespaceType =>'Genbank/GI'), 27, 1);
exit 0;
-
-$m = "<findService>
-<inputObjects>
- <Input>
- </Input>
- </inputObjects>
- <outputObjects>
- <Output>
- </Output>
- </outputObjects>
- <serviceType></serviceType>
- <Category></Category>
- <authURI>your.URI.here</authURI>;
- <expandObjects></expandObjects>
- <expandServices></expandServices>
- <authoritative></authoritative>
- <keywords>
- </keywords>
-</findService>";
-# find service based on Authority tag
-$reg = MOBY::Central->findService($m);
-my $n = grep /authURI\s*\=/, split "<", $reg;
-if ($n == 2){
- print "test 27\t\t[PASS]\n";
-} else {
- print "test 27\n\n[FAIL]\n$reg\n\n";
-}
+TEST2($C->findService(
+ serviceName => "myfirstservice2",
+ serviceType => "Retrieval",
+ authURI => "www.illuminae.com",
+ authoritative => 0,
+ category => "moby",
+ input =>[
+ ["Object"], # Simple
+ ]), 21, 1);
$m = "<findService>
More information about the MOBY-guts
mailing list