[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Mon Jun 23 17:49:36 UTC 2003
mwilkinson
Mon Jun 23 13:49:36 EDT 2003
Update of /home/repository/moby/moby-live/Perl/scripts
In directory pub.open-bio.org:/tmp/cvs-serv4593/scripts
Modified Files:
testMOBYClientCentral_v05.pl
Log Message:
tightened up Client::Central code to ensure that message structure is correct and allow flexibility in the parameters that you send in (not all are required anymore). error checking is more stringent, and the method returns a pair of objects rather than an unpredictable ServiceInstance or Registration object.
moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2003/06/23 16:05:17 1.5
+++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl 2003/06/23 17:49:35 1.6
@@ -11,13 +11,16 @@
}
}
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){
+ ($SI, $REG, $test, $expect) = @_;
+ die "\a\a\aServiceInstance Response MALFORMED" if ($SI && !(ref($SI) =~ /array/i));
+ if (defined($REG) && $expect){
+ print "test $test\t\t[FAIL]\n", $REG->message,"\n";
+ } elsif (($SI->[0] && $expect) || (!$SI->[0] && !$expect)) {
print "test $test\t\t[PASS]\n";
} else {
- print "test $test\t\t[FAIL]\n";
- }
+ print "test $test\t\t[FAIL]\nExpected to find service; didn't find service\n";
+ }
+
}
my $C = MOBY::Client::Central->new();
@@ -189,23 +192,37 @@
["Object"], # Simple
]), 21, 1);
+TEST2($C->findService(
+ serviceName => "myfirstservice2",
+ ), 22, 1);
+
+TEST2($C->findService(
+ input =>[
+ ["BlahObject"], # Simple
+ ]), 23, 0);
+
+TEST2($C->findService(
+ input =>[
+ ["Object", ['Genbank/GI']], # Simple
+ ]), 24, 1);
+
TEST($C->deregisterService(
serviceName => "myfirstservice2",
authURI => "www.illuminae.com",
- ), 22, 1);
+ ), 25, 1);
TEST($C->deregisterService(
serviceName => "myfirstservice2",
authURI => "www.illuminae.com",
- ), 23, 0);
+ ), 26, 0);
TEST($C->deregisterService(
serviceName => "myfirstservice",
authURI => "www.illuminae.com",
- ), 24, 1);
+ ), 27, 1);
-TEST($C->deregisterObjectClass(objectType => "YetMoreCrap"), 25, 1);
-TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 26, 1);
-TEST($C->deregisterNamespace(namespaceType =>'Genbank/GI'), 27, 1);
+TEST($C->deregisterObjectClass(objectType => "YetMoreCrap"), 28, 1);
+TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 29, 1);
+TEST($C->deregisterNamespace(namespaceType =>'Genbank/GI'), 30, 1);
exit 0;
More information about the MOBY-guts
mailing list