[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Wed Nov 23 20:58:36 UTC 2005
mwilkinson
Wed Nov 23 15:58:36 EST 2005
Update of /home/repository/moby/moby-live/Perl/t
In directory pub.open-bio.org:/tmp/cvs-serv17528/t
Modified Files:
Client-Central.t
Log Message:
modified the Perl Client API a little bit (in a way that is reflective of how I would like to modify it overall). Changed the Relationships call such that it returns (a) the articleName as well as the related object,and (b) returns these as a hashref rather than a listref. The MOBY Central API for the Relationships call has also changed in a way that should not break any existing code. A new attribute has been added to the objectType element in the Relationship call response. The attribute is articleName and it reflects the articleName of the associated objectType in the context of that relationship.
moby-live/Perl/t Client-Central.t,1.44,1.45
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -r1.44 -r1.45
--- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/11/22 20:05:00 1.44
+++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2005/11/23 20:58:36 1.45
@@ -51,20 +51,20 @@
# 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->deregisterObjectClass( objectType => "Rubbish" );
- $r = $C->deregisterService( serviceName => 'myfirstservice',
- authURI => 'test.suite.com' );
- $r = $C->deregisterService( serviceName => '1myfirstservice',
- authURI => 'test.suite.com' );
- $r = $C->deregisterService( serviceName => 'my]firstservice',
- authURI => 'test.suite.com' );
- $r = $C->deregisterService( serviceName => 'myf_irstservice',
- authURI => 'test.suite.com' );
- $r = $C->deregisterService( serviceName => 'mysecondservice',
- authURI => 'test.suite.com' );
- $r = $C->deregisterNamespace( namespaceType => 'RubbishNamespace' );
- $r = $C->deregisterServiceType( serviceType => 'RubbishyService' );
+# my $C = MOBY::Client::Central->new();
+# my $r = $C->deregisterObjectClass( objectType => "Rubbish" );
+# $r = $C->deregisterService( serviceName => 'myfirstservice',
+# authURI => 'test.suite.com' );
+# $r = $C->deregisterService( serviceName => '1myfirstservice',
+# authURI => 'test.suite.com' );
+# $r = $C->deregisterService( serviceName => 'my]firstservice',
+# authURI => 'test.suite.com' );
+# $r = $C->deregisterService( serviceName => 'myf_irstservice',
+# authURI => 'test.suite.com' );
+# $r = $C->deregisterService( serviceName => 'mysecondservice',
+# authURI => 'test.suite.com' );
+# $r = $C->deregisterNamespace( namespaceType => 'RubbishNamespace' );
+# $r = $C->deregisterServiceType( serviceType => 'RubbishyService' );
};
# Can we connect to the registry?
@@ -183,19 +183,22 @@
$r = $C->Relationships(objectType => $Obj{objectType});
isa_ok($r, "HASH", "Relationship types hash")
- or diag("Relationships didn't return a hashref for object types") ;
+ or diag("Object Relationships didn't return a hashref for object types") ;
isa_ok( $r->{'isa'}, 'ARRAY')
- or diag("Relationships didn't return a hash of arrayrefs");
-is(shift @{$r->{'isa'}}, "Object")
- or diag("Relationships(objectType) doesn't have the right parentage.");
+ or diag("Object Relationships didn't return a hash of arrayrefs");
+isa_ok($r->{'isa'}->[0], "HASH")
+ or diag("Object Relationships didn't return a hash of arrayrefs of hasrefs");
+is($r->{'isa'}->[0]->{term}, "Object")
+ or diag("Object Relationships(objectType) doesn't have the right parentage.");
$r = $C->Relationships(serviceType => $ServiceType{serviceType});
isa_ok($r, "HASH", "Relationship types hash")
- or diag("Relationships didn't return a hashref for service types") ;
-#print STDERR "\n\n\nkeys ",(keys %rel), "\n\n\n";
+ or diag("Service Relationships didn't return a hashref for service types") ;
isa_ok($r->{'isa'}, 'ARRAY')
- or diag("Relationships didn't return a hash of arrayrefs for services");
-is(shift @{$r->{'isa'}},
+ or diag("Service Relationships didn't return a hash of arrayrefs for services");
+isa_ok($r->{'isa'}->[0], "HASH")
+ or diag("Service Relationships didn't return a hash of arrayrefs of hasrefs");
+is($r->{'isa'}->[0]->{term},
$ServiceType{Relationships}->{ISA}->[0])
or diag("Relationships (serviceType) doesn't have the right parentage.");
More information about the MOBY-guts
mailing list