[MOBY-guts] biomoby commit
Eddie Kawas
kawas at dev.open-bio.org
Tue Sep 1 20:13:20 UTC 2009
kawas
Tue Sep 1 16:13:20 EDT 2009
Update of /home/repository/moby/moby-live/Perl/MOBY-Server/t
In directory dev.open-bio.org:/tmp/cvs-serv17301/MOBY-Server/t
Modified Files:
CommonSubs.t
Log Message:
modified CommonSubs.t to reflect that one of the tests using an incorrect namespaceURI use to pass when it should have failed.
modified CommonSubs.pm:
now we compare the actual namespaceURI to http://www.biomoby.org/moby and dont extract content unless the elements and attributes properly resolve.
CommonSubs is now more strict w.r.t. biomoby services api
moby-live/Perl/MOBY-Server/t CommonSubs.t,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY-Server/t/CommonSubs.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY-Server/t/CommonSubs.t 2008/02/21 00:21:28 1.1
+++ /home/repository/moby/moby-live/Perl/MOBY-Server/t/CommonSubs.t 2009/09/01 20:13:20 1.2
@@ -13,6 +13,10 @@
#use SOAP::Lite +trace;
use Test::More 'no_plan'; #skip_all => "Turned off for development"; #'no_plan';
use strict;
+
+use FindBin qw ($Bin);
+use lib "$Bin/../lib/";
+
use English;
use Data::Dumper;
#Is the client-code even installed?
@@ -138,7 +142,7 @@
# Test getInputArticles with one, and with more than one mobyData block.
my $two_mobyDatas = <<INP_ART;
-<MOBY xmlns:moby="http://local/namespace">
+<MOBY xmlns:moby="http://www.biomoby.org/moby">
<moby:mobyContent>
<moby:mobyData queryID="first">
<Simple>
@@ -161,6 +165,31 @@
ok ($ids[0] eq "first") or die "serviceResponseParser didn't find the first query id\n";
ok ($ids[1] eq "second") or die "serviceResponseParser didn't find the second query id that included a moby: namespace\n";
+# pass 2 invalid messages ... should not parse
+$two_mobyDatas = <<INP_ART;
+<MOBY xmlns:moby="http://www.local/namespace">
+ <moby:mobyContent>
+ <moby:mobyData queryID="first">
+ <Simple>
+ <Object namespace="blah" id="blah"/>
+ </Simple>
+ </moby:mobyData>
+ <moby:mobyData moby:queryID="second">
+ <Simple>
+ <Object namespace="blah" id="blah"/>
+ </Simple>
+ </moby:mobyData>
+ </moby:mobyContent>
+ </MOBY>
+INP_ART
+
+$responses = serviceResponseParser($two_mobyDatas); # returns MOBY objects
+print Dumper($responses);
+isa_ok ($responses, "HASH", "response parser returned a HASH" ) or die "serviceResponseParser didn't return a hashref for multiple input test\n";
+ at ids = keys %{$responses};
+ok (scalar(@ids) == 0) or die "serviceResponseParser didn't find right number of invocation messages when two invalid ones were passed\n";
+
+
my $sequence = "TAGCTGATCGAGCTGATGCTGA";
my $articlename = "SequenceString";
More information about the MOBY-guts
mailing list