From 19b53bc223f476d479b50aefa46d9a19748be222 Mon Sep 17 00:00:00 2001 From: inoussa Date: Fri, 2 Jul 2010 15:33:29 +0000 Subject: [PATCH] fix wsdl operation attributes parsing when there are multiple attributes : unit test. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1243 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tests/test_suite/files/soap_action.wsdl | 39 +++++++++++++++++++ wst/trunk/tests/test_suite/test_parsers.pas | 33 ++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 wst/trunk/tests/test_suite/files/soap_action.wsdl diff --git a/wst/trunk/tests/test_suite/files/soap_action.wsdl b/wst/trunk/tests/test_suite/files/soap_action.wsdl new file mode 100644 index 000000000..6c3a90039 --- /dev/null +++ b/wst/trunk/tests/test_suite/files/soap_action.wsdl @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wst/trunk/tests/test_suite/test_parsers.pas b/wst/trunk/tests/test_suite/test_parsers.pas index 8d2eb92a5..10700dd88 100644 --- a/wst/trunk/tests/test_suite/test_parsers.pas +++ b/wst/trunk/tests/test_suite/test_parsers.pas @@ -198,6 +198,7 @@ type procedure message_parts_type_hint(); procedure parameter_var(); procedure parameter_const_default(); + procedure soap_action(); end; implementation @@ -2665,6 +2666,38 @@ begin end; end; +procedure TTest_WsdlParser.soap_action(); +var + tr : TwstPasTreeContainer; + elt : TPasElement; + intf : TPasClassType; + i : Integer; + mth : TPasProcedure; +begin + tr := ParseDoc('soap_action'); + try //SymbolTable.Properties.SetValue(AOp,s_TRANSPORT + '_' + s_soapAction,nd.NodeValue); + elt := tr.FindElement('TestService'); + CheckNotNull(elt,'TestService'); + CheckIs(elt,TPasClassType); + intf := elt as TPasClassType; + mth := nil; + for i := 0 to (intf.Members.Count - 1) do begin + if TObject(intf.Members[i]).InheritsFrom(TPasProcedure) then begin + mth := TPasProcedure(intf.Members[i]); + Break; + end; + end; + CheckNotNull(mth,'test_proc not found'); + CheckEquals('test_proc',mth.Name); + CheckEquals( + 'http://wst.Sample/Soap/Action/', + tr.Properties.GetValue(mth,s_TRANSPORT + '_' + s_soapAction) + ); + finally + tr.Free(); + end; +end; + function TTest_WsdlParser.LoadComplexType_Class_default_values() : TwstPasTreeContainer; begin Result := ParseDoc(x_complexType_class_default);