You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Andreas Veithen <an...@skynet.be> on 2008/06/10 00:13:01 UTC
Weird unit tests for XSLTMediator
Hi all,
I just had a look at the unit tests in XSLTMediatorTest. Most of these
tests use TestUtils.getTestContextForXSLTMediator or
TestUtils.getTestContextForXSLTMediatorUsingFile to create a test
message context. It appears that both methods add two additional text
nodes to the SOAP body:
envelope.getBody().addChild(fac.createOMText("first text child "));
envelope.getBody().addChild(builder.getDocumentElement());
envelope.getBody().addChild(fac.createOMText("second text child "));
This means that most of the tests operate on a message like this:
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/
"><soapenv:Body>first text child <m0:CheckPriceRequest xmlns:m0="http://services.samples/xsd
">
<m0:Code>String</m0:Code>
</m0:CheckPriceRequest>second text child </soapenv:Body></
soapenv:Envelope>
Does anybody know the purpose of these two additional text nodes?
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org
Re: Weird unit tests for XSLTMediator
Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Andreas
> envelope.getBody().addChild(fac.createOMText("first text child "));
> envelope.getBody().addChild(builder.getDocumentElement());
> envelope.getBody().addChild(fac.createOMText("second text child "));
I think we checked this code in so as to make sure that text elements in
the input does not cause trouble with the XSLT processing. I cannot
remember or locate the exact issue, but wonder of a \r\n etc could end
up as text elements this way?
asankha
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org