[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Tue May 4 14:49:19 UTC 2010
kawas
Tue May 4 10:49:18 EDT 2010
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/t
In directory dev.open-bio.org:/tmp/cvs-serv2893/t
Modified Files:
Client-Central.t
Log Message:
added some test to check for colons in the names of serviceTypes, namespaces and datatypes
moby-live/Perl/MOBY-Server/t Client-Central.t,1.5,1.6
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/t/Client-Central.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Perl/MOBY-Server/t/Client-Central.t 2009/08/19 15:35:33 1.5
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/t/Client-Central.t 2010/05/04 14:49:18 1.6
@@ -68,10 +68,15 @@
authURI => 'test.suite.com' );
$r = $C->deregisterService( serviceName => 'myfirstservicemultiplesimples',
authURI => 'test.suite.com' );
+
$r = $C->deregisterObjectClass( objectType => "Rubbish" );
$r = $C->deregisterObjectClass( objectType => "Rubbish_Art" );
+
$r = $C->deregisterNamespace( namespaceType => 'RubbishNamespace' );
+ $r = $C->deregisterNamespace( namespaceType => 'Rubbish:Namespace');
+
$r = $C->deregisterServiceType( serviceType => 'RubbishyService' );
+ $r = $C->deregisterServiceType( serviceType => 'Rubbishy:Service' );
$r = $C->deregisterServiceType( serviceType => 'RubbishyServiceNoParent' );
}
@@ -247,6 +252,35 @@
. $r->message );
$r = $C->deregisterObjectClass( objectType => "Rubbish_'Art" );
+# confirm that we cannot register a datatype with : characters in its name
+$r = $C->registerObjectClass(
+ (
+ objectType => "Rubbish:Art",
+ description => "a human-readable description of the object",
+ contactEmail => 'your at email.address',
+ authURI => "test.suite.com",
+ Relationships => {
+ ISA => [
+ {
+ object => 'Object',
+ articleName => 'article1'
+ }
+ ],
+ HASA => [
+ {
+ object => 'Object',
+ articleName => 'articleName3'
+ },
+ ]
+ }
+ )
+);
+ok( !$r->success, "Object registration correctly failed" )
+ or diag(
+ "Shouldn't be possible to register Object with a ':' character in its name!"
+ . $r->message );
+$r = $C->deregisterObjectClass( objectType => "Rubbish:Art" );
+
# confirm that we cannot register a datatype with odd characters in its name
$r = $C->registerObjectClass(
(
@@ -347,6 +381,19 @@
ok( $r->success, "Name space registration successful" )
or diag( "Name space registration failure: " . $r->message );
+# check for invalid namespace registration
+
+my %InvalidNamespace = (
+ namespaceType => 'Rubbish:Namespace',
+ authURI => 'your.authority.URI',
+ description => "human readable description of namespace",
+ contactEmail => 'your at address.here'
+);
+$r = $C->registerNamespace(%InvalidNamespace);
+ok( !$r->success, "Name space registration correctly failed with a ':' in the name" )
+ or diag( "Name space registration incorrectly succeeded with a ':' in the name: " . $r->message );
+$C->deregisterNamespace(%InvalidNamespace);
+
############ SERVICE-TYPE REGISTRATION #############
#this registration should fail => empty relationship type
my %ServiceType = (
@@ -394,6 +441,19 @@
is( $r->{'isa'}->[0]->{term}, $ServiceType{Relationships}->{ISA}->[0] )
or diag("Relationships (serviceType) doesn't have the right parentage.");
+# check for invalid service type
+my %InvalidServiceType = (
+ serviceType => "Rubbishy:Service",
+ description => "a human-readable description of the service",
+ contactEmail => 'your at email.address',
+ authURI => "test.suite.com",
+ Relationships => { ISA => ['Retrieval'] }
+);
+$r = $C->registerServiceType(%InvalidServiceType);
+ok( !$r->success, "Service Type registration with a ':' in the name correctly failed" )
+ or diag( "Service Type registration incorrectly succeeded with a ':' in the name: " . $r->message );
+$C->deregisterServiceType(%InvalidServiceType);
+
############# SERVICE INSTANCE REGISTRATION ###########
# Set up a service registration hash. We'll mess with it piece by piece in the next several tests,
# to make sure that registration is successful when you play by the rules.
More information about the MOBY-guts
mailing list