[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Wed Nov 12 17:31:43 UTC 2003
mwilkinson
Wed Nov 12 12:31:43 EST 2003
Update of /home/repository/moby/moby-live/Perl/t
In directory pub.open-bio.org:/tmp/cvs-serv12338/t
Modified Files:
Client-Central.t
Log Message:
Yay! We have a Makefile and test suite again! This is more simple than the one that Richard was working on at the Singapore hackathon (his was able to actually install and test local services), but this will at least install the modules and test the basic functionality of MOBY::Client::Central
moby-live/Perl/t Client-Central.t,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/t/Client-Central.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/02/19 21:23:16 1.1
+++ /home/repository/moby/moby-live/Perl/t/Client-Central.t 2003/11/12 17:31:42 1.2
@@ -5,187 +5,249 @@
# change 'tests => 1' to 'tests => last_test_to_print';
-use Test::More tests => 20; # perldoc Test::More for details
+use Test::More tests => 12; # perldoc Test::More for details
# Test 1
BEGIN { use_ok('MOBY::Client::Central') };
# Test 2
my $C = MOBY::Client::Central->new(
- MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl",
- MOBY_uri => "http://localhost/MOBY/Central"
+ #MOBY_server => "http://localhost/cgi-bin/MOBY-Central.pl",
+ #MOBY_uri => "http://localhost/MOBY/Central"
);
isa_ok( $C,'MOBY::Client::Central',"Connected to test MOBY Central") or
- die("Cannot Connect to test MOBY Central... cannot continue?");
+ die("Cannot Connect to MOBY Central... cannot continue?");
my %TestRegistry ; # to keep track of registry id's for the various tests
################## MOBY Registration Tests #################
# Test 3
-$r = $C->registerObject(
- objectType => "testObject",
- description => "this is a test",
- xsd => "<blah><blah><blah>",
- ISA => ["Object"],
- authURI => "http://www.illuminae.com",
- clobber => 0,
+$r = $C->registerObjectClass(objectType => "TotalCrap",
+ description => "a human-readable description of the object",
+ contactEmail => 'your at email.address',
+ authURI => "URI of the registrar of this object",
+ Relationships => {
+ ISA => [
+ ['Object', 'article1'],
+ ['Object', 'articleName2']],
+ HASA => [
+ ['Object', 'articleName3']]}
);
-( ok(!$r->success,"Object registration successful") and
- ($TestRegistry{'Object'} = $r->registration_id)
-) or diag("Object registration failure: ".$r->error_message) ;
+( ok($r->success,"Object registration successful")
+ or diag("Object registration failure: ".$r->message));
+
# Test 4
-$r = $C->registerServiceType(
- serviceType => "testService",
- description => "this is a test",
- ISA => ["Retrieve"],
+$r = $C->deregisterObjectClass(objectType => "TotalCrap");
+( ok($r->success,"Object deregistration successful"))
+or diag("Object deregistration failure: ".$r->message) ;
+
+# Test 5 (identical to #3
+$r = $C->registerObjectClass(objectType => "TotalCrap",
+ description => "a human-readable description of the object",
+ contactEmail => 'your at email.address',
+ authURI => "URI of the registrar of this object",
+ Relationships => {
+ ISA => [
+ ['Object', 'article1'],
+ ['Object', 'articleName2']],
+ HASA => [
+ ['Object', 'articleName3']]}
);
-( ok(!$r->success,"Service type registration successful") and
- ($TestRegistry{'ServiceType'} = $r->registration_id)
-) or diag("Service type registration failure: ".$r->error_message) ;
+( ok($r->success,"Object registration successful")
+ or diag("Object registration failure: ".$r->message));
+
-# Test 5
+# Test 6
$r = $C->registerNamespace(
- namespaceType => "testNamespace",
- description => "this is a test",
- authURI => "http://illuminae.com",
- clobber => 0
+ namespaceType =>'UglyNamespace',
+ authURI => 'your.authority.URI',
+ description => "human readable description of namespace",
+ contactEmail => 'your at address.here');
+( ok($r->success,"Name space registration successful")
+) or diag("Name space registration failure: ".$r->message) ;
+
+
+# Test 7
+$r = $C->registerServiceType(serviceType => "CrappyService",
+ description => "a human-readable description of the service",
+ contactEmail => 'your at email.address',
+ authURI => "URI of the registrar of this object",
+ Relationships => {
+ ISA => ['Retrieval']}
);
-( ok(!$r->success,"Name space registration successful") and
- ($TestRegistry{'NameSpace'} = $r->registration_id)
-) or diag("Name space registration failure: ".$r->error_message) ;
+( ok($r->success,"Service Type registration successful")
+) or diag("Service Type registration failure: ".$r->message) ;
-# Test 6
+# Test 8
$r = $C->registerService(
- serviceName => "Servicetest2",
- serviceType => "Retrieve",
- authURI => "illuminae.com",
- input => {"Object" => ["Genbank/GI"]},
- output => ["Object"],
- URL => "http://www.illuminae.com/cgi-bin/services.cgi",
- description => "this is a test",
- );
-( ok(!$r->success,"Service registration successful") and
- ($TestRegistry{'Service'} = $r->registration_id)
-) or diag("Name space registration failure: ".$r->error_message) ;
-
-################## MOBY Central Search Tests #################
-
-my @service ;
-
-# Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services
- at service = $C->locateServiceByOutput(
- objectType => "Object",
- fullObjects => 1,
- fullServices => 1,
-) ;
-
-SKIP: {
- skip "locateServiceByOutput w/full object & services".
- "did not return any services?", 2 unless scalar(@service) ;
- is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
- is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
-} ;
-
-# Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only
- at service = $C->locateServiceByOutput(
- objectType => "Object",
- fullObjects => 0,
- fullServices => 1,
- );
-SKIP: {
- skip "locateServiceByOutput w/ output 'Object' and full services only ".
- "did not return any services?", 2 unless scalar(@service) ;
- is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
- is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
-} ;
-
-# Tests 11,12: Testing locateServiceByInput with input
-# 'Object' => Genbank/GI and full_objects + full_services
- at service = $C->locateServiceByInput(
- input => {"Sequence" => ["Genbank/GI"]},
- fullObjects => 1,
- fullServices => 1,
- );
-SKIP: {
- skip "locateServiceByInput w/input 'Object' => Genbank/GI ".
- "and full_objects + full_services ".
- "did not return any services?", 2 unless scalar(@service) ;
- is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
- is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
-} ;
-
-# Tests 13,14: Testing locateServiceByInput with input
-# 'Object' => Genbank/GI and full_services only
- at service = $C->locateServiceByInput(
- input => {"Object" => ["Genbank/GI"]},
- fullObjects => 0,
- fullServices => 1,
- );
-SKIP: {
- skip "locateServiceByInput w/input 'Object' => Genbank/GI ".
- "and full_services ".
- "did not return any services?", 2 unless scalar(@service) ;
- is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
- is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
-} ;
-
-# Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services
- at service = $C->locateServiceByType(
- serviceType => "Retrieve",
- fullServices => 1,
- );
-SKIP: {
- skip "locateServiceByType w/type 'Retrieve' and full_services ".
- "did not return any services?", 2 unless scalar(@service) ;
- is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
- is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
-} ;
-
-################## MOBY Deregistration Tests #################
-
-# Test 17
-SKIP: {
- skip "Skipping test DeregisterService since service registration failed",
- 1 unless(exists($TestRegistry{'Service'})) ;
-
- $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} );
- ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful")
- or diag("Service ID#",$TestRegistry{'Service'},
- "deregistration failure: ".$r->error_message) ;
-}
-
-# Test 18
-SKIP: {
- skip "Skipping test DeregisterNamespace since name space registration failed",
- 1 unless(exists($TestRegistry{'NameSpace'})) ;
-
- $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} );
- ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful")
- or diag("Name space ID#",$TestRegistry{'NameSpace'},
- "deregistration failure: ".$r->error_message) ;
-}
-
-# Test 19
-SKIP: {
- skip "Skipping test DeregisterServiceType since service registration failed",
- 1 unless(exists($TestRegistry{'ServiceType'})) ;
-
- $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} );
- ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful")
- or diag("Service type ID#",$TestRegistry{'ServiceType'},
- "deregistration failure: ".$r->error_message) ;
-}
-
-# Test 20
-SKIP: {
- skip "Skipping test DeregisterObject since initial object registration failed",
- 1 unless(exists($TestRegistry{'Object'})) ;
-
- $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} );
- ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful")
- or diag("Object ID#",$TestRegistry{'Object'},
- "deregistration failure: ".$r->error_message) ;
-}
+ serviceName => "myfirstservice",
+ serviceType => "Retrieval",
+ authURI => "www.illuminae.com",
+ contactEmail => 'your at mail.address',
+ description => "this is my first service",
+ category => "moby",
+ URL => "http://illuminae/cgi-bin/service.pl",
+ input =>[
+ ['articleName1', [Object => ['UglyNamespace']]], # Simple
+ ],
+ output =>[
+ ['articleName2', [String => ['UglyNamespace']]], # Simple
+ ],
+ secondary => {
+ parametername1 => {
+ datatype => 'Int',
+ default => 0,
+ max => 10,
+ min => -10,
+ enum => [-10, 10, 0]}});
+
+( ok($r->success,"Service registration successful")
+) or diag("Service registration failure: ".$r->message) ;
+
+
+# Test 9
+
+$r = $C->deregisterService(
+ serviceName => "myfirstservice",
+ authURI => "www.illuminae.com",
+ );
+( ok($r->success,"Service deregistration successful")
+) or diag("Service deregistration failure: ".$r->message) ;
+
+
+# Test 10
+$r = $C->deregisterObjectClass(objectType => "TotalCrap");
+( ok($r->success,"Object deregistration successful")
+) or diag("Object deregistration failure: ".$r->message) ;
+
+# Test 11
+$r = $C->deregisterServiceType(serviceType => "CrappyService");
+( ok($r->success,"Service Type deregistration successful")
+) or diag("Service Type deregistration failure: ".$r->message) ;
+
+# Test 12
+$r = $C->deregisterNamespace(namespaceType =>'UglyNamespace');
+( ok($r->success,"namespace deregistration successful")
+) or diag("namespace deregistration failure: ".$r->message) ;
+
+################### MOBY Central Search Tests #################
+#
+#my @service ;
+#
+## Tests 7,8: locateServiceByOutput with output 'Object' and full_objects + full_services
+#@service = $C->locateServiceByOutput(
+# objectType => "Object",
+# fullObjects => 1,
+# fullServices => 1,
+#) ;
+#
+#SKIP: {
+# skip "locateServiceByOutput w/full object & services".
+# "did not return any services?", 2 unless scalar(@service) ;
+# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
+# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
+#} ;
+#
+## Tests 9,10: Testing locateServiceByOutput with output "Object" and full_services only
+#@service = $C->locateServiceByOutput(
+# objectType => "Object",
+# fullObjects => 0,
+# fullServices => 1,
+# );
+#SKIP: {
+# skip "locateServiceByOutput w/ output 'Object' and full services only ".
+# "did not return any services?", 2 unless scalar(@service) ;
+# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
+# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
+#} ;
+#
+## Tests 11,12: Testing locateServiceByInput with input
+## 'Object' => Genbank/GI and full_objects + full_services
+#@service = $C->locateServiceByInput(
+# input => {"Sequence" => ["Genbank/GI"]},
+# fullObjects => 1,
+# fullServices => 1,
+# );
+#SKIP: {
+# skip "locateServiceByInput w/input 'Object' => Genbank/GI ".
+# "and full_objects + full_services ".
+# "did not return any services?", 2 unless scalar(@service) ;
+# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
+# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
+#} ;
+#
+## Tests 13,14: Testing locateServiceByInput with input
+## 'Object' => Genbank/GI and full_services only
+#@service = $C->locateServiceByInput(
+# input => {"Object" => ["Genbank/GI"]},
+# fullObjects => 0,
+# fullServices => 1,
+# );
+#SKIP: {
+# skip "locateServiceByInput w/input 'Object' => Genbank/GI ".
+# "and full_services ".
+# "did not return any services?", 2 unless scalar(@service) ;
+# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
+# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
+#} ;
+#
+## Tests 15,16: Testing locateServiceByType with type 'Retrieve' + full_services
+#@service = $C->locateServiceByType(
+# serviceType => "Retrieve",
+# fullServices => 1,
+# );
+#SKIP: {
+# skip "locateServiceByType w/type 'Retrieve' and full_services ".
+# "did not return any services?", 2 unless scalar(@service) ;
+# is($service[0]->authority,"illuminae.com","locateServiceByOutput authority") ;
+# is($service[0]->name,"Servicetest2","locateServiceByOutput service name") ;
+#} ;
+#
+################### MOBY Deregistration Tests #################
+#
+## Test 17
+#SKIP: {
+# skip "Skipping test DeregisterService since service registration failed",
+# 1 unless(exists($TestRegistry{'Service'})) ;
+#
+# $r = $C->deregisterService( serviceID => $TestRegistry{'Service'} );
+# ok(!$r->success,"Service ID#".$r->registration_id." deregistration successful")
+# or diag("Service ID#",$TestRegistry{'Service'},
+# "deregistration failure: ".$r->message) ;
+#}
+#
+## Test 18
+#SKIP: {
+# skip "Skipping test DeregisterNamespace since name space registration failed",
+# 1 unless(exists($TestRegistry{'NameSpace'})) ;
+#
+# $r = $C->deregisterNamespace( namespaceAcc => $TestRegistry{'NameSpace'} );
+# ok(!$r->success,"Name space ID#".$r->registration_id." deregistration successful")
+# or diag("Name space ID#",$TestRegistry{'NameSpace'},
+# "deregistration failure: ".$r->message) ;
+#}
+#
+## Test 19
+#SKIP: {
+# skip "Skipping test DeregisterServiceType since service registration failed",
+# 1 unless(exists($TestRegistry{'ServiceType'})) ;
+#
+# $r = $C->deregisterServiceType( serviceID => $TestRegistry{'ServiceType'} );
+# ok(!$r->success,"Service type ID#".$r->registration_id." deregistration successful")
+# or diag("Service type ID#",$TestRegistry{'ServiceType'},
+# "deregistration failure: ".$r->message) ;
+#}
+#
+## Test 20
+#SKIP: {
+# skip "Skipping test DeregisterObject since initial object registration failed",
+# 1 unless(exists($TestRegistry{'Object'})) ;
+#
+# $r = $C->deregisterObject( serviceID => $TestRegistry{'Object'} );
+# ok(!$r->success,"Object ID#".$r->registration_id." deregistration successful")
+# or diag("Object ID#",$TestRegistry{'Object'},
+# "deregistration failure: ".$r->message) ;
+#}
More information about the MOBY-guts
mailing list