[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Aug 17 17:58:13 UTC 2005


mwilkinson
Wed Aug 17 13:58:13 EDT 2005
Update of /home/repository/moby/moby-live/Perl/t
In directory pub.open-bio.org:/tmp/cvs-serv13547/t

Modified Files:
	Client-Central.t 
Log Message:
adding restrictions to serviceName to be valid method calls.  Added tests to ensure this is obeyed

moby-live/Perl/t Client-Central.t,1.28,1.29
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- /home/repository/moby/moby-live/Perl/t/Client-Central.t	2005/08/04 09:05:38	1.28
+++ /home/repository/moby/moby-live/Perl/t/Client-Central.t	2005/08/17 17:58:13	1.29
@@ -150,8 +150,59 @@
 is(shift(@{$rel{'urn:lsid:biomoby.org:servicerelation:isa'}}), "Retrieval") or diag("Relationships arrayref didn't return the right parentage for service types.");
 
 
+# test for invalid serviceName
+$r = $C->registerService(
+    serviceName  => "1myfirstservice",  
+    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 => ['RubbishNamespace']]], # Simple
+	        ],
+	output =>[
+        ['articleName2', [String => ['RubbishNamespace']]], # Simple
+	         ],
+	secondary => {
+        parametername1 => {
+            datatype => 'Integer',
+    		default => 0,
+			max => 10,
+			min => -10,
+			enum => [-10, 10, 0]}});
+
+( ok(!$r->success,"Service registration correctly failed with number as first character in serviceName")
+) or diag("Service registration shuld have failed with numberical first character in servieName: ".$r->message) ;
+
+# test for invalid serviceName
+$r = $C->registerService(
+    serviceName  => "myf]irstservice",  
+    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 => ['RubbishNamespace']]], # Simple
+	        ],
+	output =>[
+        ['articleName2', [String => ['RubbishNamespace']]], # Simple
+	         ],
+	secondary => {
+        parametername1 => {
+            datatype => 'Integer',
+    		default => 0,
+			max => 10,
+			min => -10,
+			enum => [-10, 10, 0]}});
+
+( ok(!$r->success,"Service registration correctly failed with ']' as character in serviceName")
+) or diag("Service registration shuld have failed with invalid character in serviceName: ".$r->message) ;
+
 
-# Test 9  # should fail due to datatype all caps
 $r = $C->registerService(
     serviceName  => "myfirstservice",  
     serviceType  => "Retrieval",  




More information about the MOBY-guts mailing list