[MOBY-guts] biomoby commit
Frank Gibbons
fgibbons at pub.open-bio.org
Tue Sep 6 20:47:04 UTC 2005
fgibbons
Tue Sep 6 16:47:04 EDT 2005
Update of /home/repository/moby/moby-live/Perl/t
In directory pub.open-bio.org:/tmp/cvs-serv4393/t
Added Files:
Central.t Config.t dbConnect.t
Log Message:
- Add tests for various components.
moby-live/Perl/t Central.t,1.2,1.3 Config.t,NONE,1.1 dbConnect.t,NONE,1.1
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Central.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- /home/repository/moby/moby-live/Perl/t/Central.t 2003/11/12 17:05:48 1.2
+++ /home/repository/moby/moby-live/Perl/t/Central.t 2005/09/06 20:47:04 1.3
@@ -1,15 +1,76 @@
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl 1.t'
+# !!!!STOP!!!!
+# This test file is for the MOBY::Central module.
+# As a regular Perl user, you probably intend to use MOBY::Client::Central,
+# which is discouragingly similarly named, and has many similarly named methods,
+# but quite different functionality.
+# This code runs on the server side, responding to incoming requests,
+# and constructing XML messages that communicate the results of those requests.
+
+# Note added by Frank Gibbons.
+# Tests should, as far as possible, avoid the use of literals.
+# If you register a service with authURI => mysite.com,
+# and you want to test a retrieved description of the service, don't test that the service returns authURI eq "mysite.com",
+# test so that it returns the same value as you used to register it in the first place.
+
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
-
-use Test::More tests => 1;
+#use SOAP::Lite +trace;
+use Test::More 'no_plan';
+use strict;
+use Data::Dumper;
+#Is the client-code even installed?
BEGIN { use_ok('MOBY::Central') };
+
+END {};
-#########################
+############ ENFORCE REGISTRY API ###############
-# Insert your test code below, the Test::More module is use()ed here so read
-# its man page ( perldoc Test::More ) for help writing this test script.
+# First, mandatory methods for all registries.
+# Notice: new() is NOT defined here, since it is deprecated.
+my @API = qw/Registration
+registerObjectClass _registerObjectPayload
+deregisterObjectClass _deregisterObjectPayload
+_testObjectTypeAgainstPrimitives
+registerServiceType _registerServiceTypePayload
+deregisterServiceType _deregisterServiceTypePayload
+retrieveNamespaces _registerNamespacePayload
+deregisterNamespace _deregisterNamespacePayload
+registerService _registerServicePayload
+_getServiceInstanceRDF _registerArticles
+deregisterService _deregisterServicePayload
+findService _findServicePayload
+_extractObjectTypes registerServiceWSDL
+_extract_ids
+_searchForServicesWithArticle _searchForSimple _searchForCollection
+_extractObjectTypesAndNamespaces
+retrieveService _retrieveServicePayload
+retrieveResourceURLs retrieveServiceProviders retrieveServiceNames
+retrieveServiceTypes retrieveRelationshipTypes retrieveObjectNames
+retrieveObjectDefinition retrieveNamespaces
+retrieveObject _retrieveObjectPayload
+Relationships DUMP_MySQL _ISAPayload/;
+
+can_ok("MOBY::Central", @API)
+ or diag("MOBY::Central failed to implement full API");
+
+################## MOBY Registration Tests #################
+
+################## OBJECT REGISTRATION #############
+# Test 3 inherits from two isas - should fail
+my %Obj = ( objectType => "Rubbish",
+ description => "a human-readable description of the object",
+ contactEmail => 'your at email.address',
+ authURI => "test.suite.com",
+ Relationships => {
+ ISA => [
+ ['Object', 'article1'],
+ ['Object', 'articleName2']],
+ HASA => [
+ ['Object', 'articleName3']]
+ }
+ );
More information about the MOBY-guts
mailing list