[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Jul 12 00:39:37 UTC 2004


mwilkinson
Sun Jul 11 20:39:37 EDT 2004
Update of /home/repository/moby/moby-live/Perl/scripts
In directory pub.open-bio.org:/tmp/cvs-serv25446/scripts

Modified Files:
	testMOBYClientCentral_v05.pl 
Log Message:
tightening the business logic of MOBY Object registration, as I now see a few objects in the ontology that are invalid.

moby-live/Perl/scripts testMOBYClientCentral_v05.pl,1.18,1.19
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl	2004/07/09 00:21:53	1.18
+++ /home/repository/moby/moby-live/Perl/scripts/testMOBYClientCentral_v05.pl	2004/07/12 00:39:37	1.19
@@ -1,13 +1,15 @@
 #!/usr/bin/perl -w
 use MOBY::Client::Central;
 
+my $v = 1 if ($ARGV[0] eq "verbose");
+
 sub TEST {  # test of Registration object
     ($reg, $test, $expect) = @_;
     die "\a\a\aREG OBJECT MALFORMED" unless $reg;
     if ($reg->success == $expect){
-        print "test $test\t\t[PASS]\n";
+        print "test $test\t\t[PASS] ", ($v?($reg->message):""),"\n";
     } else {
-        print "test $test\t\t[FAIL]\n",$reg->message,"\n\n";
+        print "test $test\t\t[FAIL] ",$reg->message,"\n\n";
     }
 }
 sub TEST2 {  # test of ServiceInstance object listref
@@ -31,8 +33,8 @@
 );
 
 
-#reg first object class 
-TEST($C->registerObjectClass(objectType => "TotalCrap",
+#register with two ISA's -> should fail
+TEST($C->registerObjectClass(objectType => "HypotheticalObject1",
                 description => "a human-readable description of the object",
 		contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
@@ -42,35 +44,56 @@
 						['Object', 'articleName2']],
 					HASA => [
 						['Object', 'articleName3']]}
+                       ), '1a', 0);
+
+#register with no ISA's -> should fail
+TEST($C->registerObjectClass(objectType => "HypotheticalObject1",
+                description => "a human-readable description of the object",
+		contactEmail => 'your at email.address',
+                authURI => "blah.blah.blah",
+			    Relationships => {
+					HASA => [
+						['Object', 'articleName3']]}
+                       ), '1b', 0);
+
+#reg first object class with a single ISA -> should pass
+TEST($C->registerObjectClass(objectType => "HypotheticalObject1",
+                description => "a human-readable description of the object",
+		contactEmail => 'your at email.address',
+                authURI => "blah.blah.blah",
+			    Relationships => {
+					ISA => [
+						['Object', 'articleName2']],
+					HASA => [
+						['Object', 'articleName3']]}
                        ), 1, 1);
 
 #reg duplicate object class
-TEST($C->registerObjectClass(objectType => "TotalCrap",
+TEST($C->registerObjectClass(objectType => "HypotheticalObject1",
                 description => "a human-readable description of the object",
 				contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
 			    Relationships => {
 					ISA => [
-						['Object', 'article1'],
-						['Object', 'articleName2']],
+						['Object', 'article1']
+						],
 					HASA => [
 						['Object', 'articleName3']]}
                        ), 2, 0);
 
 #reg second object class
-TEST($C->registerObjectClass(objectType => "YetMoreCrap",
+TEST($C->registerObjectClass(objectType => "HypotheticalObject2",
                 description => "a human-readable description of the object",
 				contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
 			    Relationships => {
 					ISA => [
-						['Object', 'article1'],
 						['Object', 'articleName2']],
 					HASA => [
 						['Object', 'articleName3']]}
                        ), 3, 1);
 
-TEST($C->registerServiceType(serviceType => "CrappyService",
+TEST($C->registerServiceType(serviceType => "HypotheticalService1",
                 description => "a human-readable description of the service",
 				contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
@@ -78,7 +101,7 @@
 					ISA => ['Retrieval','Analysis']}
                        ), 4, 1);
 
-TEST($C->registerServiceType(serviceType => "CrappyService",
+TEST($C->registerServiceType(serviceType => "HypotheticalService1",
                 description => "a human-readable description of the service",
 				contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
@@ -86,28 +109,28 @@
 					ISA => ['Retrieval','Analysis']}
                        ), 5, 0);
 
-TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 6, 1);
-TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 7, 0);
-TEST($C->deregisterObjectClass(objectType => "YetMoreCrap"), 8, 1);
-TEST($C->deregisterServiceType(serviceType => "CrappyService"), 9, 1);
-TEST($C->deregisterServiceType(serviceType => "CrappyService"), 10, 0);
+TEST($C->deregisterObjectClass(objectType => "HypotheticalObject1"), 6, 1);
+TEST($C->deregisterObjectClass(objectType => "HypotheticalObject1"), 7, 0);
+TEST($C->deregisterObjectClass(objectType => "HypotheticalObject2"), 8, 1);
+TEST($C->deregisterServiceType(serviceType => "HypotheticalService1"), 9, 1);
+TEST($C->deregisterServiceType(serviceType => "HypotheticalService1"), 10, 0);
 TEST($C->registerNamespace(
-    namespaceType =>'UglyNamespace',
+    namespaceType =>'HypotheticalNamespace1',
     authURI => 'your.authority.URI',
     description => "human readable description of namespace",
     contactEmail => 'your at address.here'), 11, 1);
 TEST($C->registerNamespace(
-    namespaceType =>'UglyNamespace',
+    namespaceType =>'HypotheticalNamespace1',
     authURI => 'your.authority.URI',
     description => "human readable description of namespace",
     contactEmail => 'your at address.here'), 12, 0);
-TEST($C->deregisterNamespace(namespaceType =>'UglyNamespace'), 13, 1);
+TEST($C->deregisterNamespace(namespaceType =>'HypotheticalNamespace1'), 13, 1);
 
 
 #reg first object class 
-TEST($C->registerObjectClass(objectType => "TotalCrap",
+TEST($C->registerObjectClass(objectType => "HypotheticalObject1",
                 description => "a human-readable description of the object",
-				contactEmail => 'your at email.address',
+		contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
 			    Relationships => {
 					ISA => [
@@ -115,19 +138,19 @@
                        ), 14, 1);
 
 #reg duplicate object class
-TEST($C->registerObjectClass(objectType => "YetMoreCrap",
+TEST($C->registerObjectClass(objectType => "HypotheticalObject2",
                 description => "a human-readable description of the object",
 				contactEmail => 'your at email.address',
                 authURI => "blah.blah.blah",
 			    Relationships => {
 					ISA => [
-						['TotalCrap', 'article1']]}
+						['HypotheticalObject1', 'article1']]}
                        ), 15, 1);
 
-TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 16, 0);
+TEST($C->deregisterObjectClass(objectType => "HypotheticalObject1"), 16, 0);
 
 TEST($C->registerNamespace(
-    namespaceType =>'UglyNamespace',
+    namespaceType =>'HypotheticalNamespace1',
     authURI => 'your.authority.URI',
     description => "human readable description of namespace",
     contactEmail => 'your at address.here'), 17, 1);
@@ -141,10 +164,10 @@
     category  =>  "moby",
     URL    =>  "http://illuminae/cgi-bin/service.pl",
 	input =>[
-        ['articleName1', [Object => ['UglyNamespace']]], # Simple
+        ['articleName1', [Object => ['HypotheticalNamespace1']]], # Simple
 	        ],
 	output =>[
-        ['articleName2', [String => ['UglyNamespace']]], # Simple
+        ['articleName2', [String => ['HypotheticalNamespace1']]], # Simple
 	         ],
 	secondary => {
         parametername1 => {
@@ -163,10 +186,10 @@
     category  =>  "moby",
     URL    =>  "http://illuminae/cgi-bin/service.pl",
 	input =>[
-        ['articleName1', [Object => ['UglyNamespace']]], # Simple
+        ['articleName1', [Object => ['HypotheticalNamespace1']]], # Simple
 	        ],
 	output =>[
-        ['articleName2', [String => ['UglyNamespace']]], # Simple
+        ['articleName2', [String => ['HypotheticalNamespace1']]], # Simple
 	         ],
 	), 19, 0);
 
@@ -179,11 +202,11 @@
     category  =>  "moby",
     URL    =>  "http://illuminae/cgi-bin/service.pl",
 	input =>[
-#        ['articleName1', [[Object => ['UglyNamespace']]]], # Collection
-	        ['articleName1', [Object => ['UglyNamespace']]], # Simple
+#        ['articleName1', [[Object => ['HypotheticalNamespace1']]]], # Collection
+	        ['articleName1', [Object => ['HypotheticalNamespace1']]], # Simple
 	        ],
 	output =>[
-        ['articleName2', [String => ['UglyNamespace']]], # Simple
+        ['articleName2', [String => ['HypotheticalNamespace1']]], # Simple
 	         ],
 	), 20, 1);
 
@@ -210,7 +233,7 @@
 
 TEST2($C->findService(
      input =>[
-              ["Object", ['UglyNamespace']], # Simple
+              ["Object", ['HypotheticalNamespace1']], # Simple
               ]), 24, 1);
 
 my ($si, $reg) = $C->findService(
@@ -241,9 +264,9 @@
     authURI      => "www.illuminae.com",      
     ), 28, 1);
 
-TEST($C->deregisterObjectClass(objectType => "YetMoreCrap"), 28, 1);
-TEST($C->deregisterObjectClass(objectType => "TotalCrap"), 29, 1);
-TEST($C->deregisterNamespace(namespaceType =>'UglyNamespace'), 30, 1);
+TEST($C->deregisterObjectClass(objectType => "HypotheticalObject2"), 28, 1);
+TEST($C->deregisterObjectClass(objectType => "HypotheticalObject1"), 29, 1);
+TEST($C->deregisterNamespace(namespaceType =>'HypotheticalNamespace1'), 30, 1);
 
 exit 0;
 




More information about the MOBY-guts mailing list