[Catalyst-commits] r10436 - Catalyst-Model-SOAP/1.0/trunk/t

ruoso at dev.catalyst.perl.org ruoso at dev.catalyst.perl.org
Fri Jun 5 20:31:19 GMT 2009


Author: ruoso
Date: 2009-06-05 20:31:19 +0000 (Fri, 05 Jun 2009)
New Revision: 10436

Added:
   Catalyst-Model-SOAP/1.0/trunk/t/05_rpcliteral_oneway.t
Modified:
   Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl
Log:
[C-M-SOAP] add a test for rpc literal, one way

Added: Catalyst-Model-SOAP/1.0/trunk/t/05_rpcliteral_oneway.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/05_rpcliteral_oneway.t	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/05_rpcliteral_oneway.t	2009-06-05 20:31:19 UTC (rev 10436)
@@ -0,0 +1,33 @@
+use Test::More tests => 3, todo => 3;
+use Symbol;
+use XML::Compile;
+use XML::Compile::Transport::SOAPHTTP;
+BEGIN { use_ok('Catalyst::Model::SOAP') };
+
+use lib 't/lib/';
+use TestTransport;
+
+use XML::LibXML;
+my $parser = XML::LibXML->new();
+our $test_code;
+{
+  package MyFooModel;
+  use base qw(Catalyst::Model::SOAP);
+  __PACKAGE__->config->{transport} =
+    TestTransport->new
+      (sub {
+         return $test_code->(@_);
+       });
+  __PACKAGE__->register_wsdl('t/hello4.wsdl', { Greet => 'Bar::Baz' });
+};
+
+# now we check if the body is consistent
+$test_code = sub {
+  my $message = shift->toString;
+  ok($message =~ /Hello|World/g, 'Output message contain parameters.');
+
+  return ''
+};
+my $ret = MyFooModel::Bar::Baz->Blag
+  ({ who => 'World', greeting => 'Hello' });
+is('', '', 'Output message processed!');

Modified: Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl	2009-06-05 19:52:56 UTC (rev 10435)
+++ Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl	2009-06-05 20:31:19 UTC (rev 10436)
@@ -30,6 +30,9 @@
       <wsdl:input message="hello:AskGreeting"/>
       <wsdl:output message="hello:GiveGreeting"/>
     </wsdl:operation>
+    <wsdl:operation name="Blag">
+      <wsdl:input message="hello:AskGreeting"/>
+    </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="Greeting" type="hello:Greeting">
     <soap:binding transport="http://jabber.org/protocol/soap" style="rpc"/>
@@ -49,6 +52,11 @@
         <soap:body use="literal" namespace="http://example.com/hello"/>
       </wsdl:output>
     </wsdl:operation>
+    <wsdl:operation name="Blag">
+      <wsdl:input>
+        <soap:body use="literal" namespace="http://example.com/hello"/>
+      </wsdl:input>
+    </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="GreetService">
     <wsdl:port name="Greet" binding="hello:Greeting">




More information about the Catalyst-commits mailing list