SWS-1007 - Fix invalid test cases that close the InputStream too early

Since Axiom uses deferred parsing, the underlying InputStream must not be closed before the message has been fully processed or the detach() method on the builder has been called. That constraint was violated by a few test cases. This doesn't cause problems with Axiom 1.2.x (presumably because the test messages are small enough), but the build fails with Axiom 1.3.0-SNAPSHOT.
This commit is contained in:
Andreas Veithen
2017-05-22 22:10:21 +01:00
committed by Greg Turnquist
parent 8c3df71531
commit f36e8ca50c

View File

@@ -154,6 +154,7 @@ public abstract class Wss4jTestCase {
SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(is, null);
org.apache.axiom.soap.SOAPMessage soapMessage = builder.getSOAPMessage();
builder.detach();
return new AxiomSoapMessage(soapMessage, "", true, true);
}
finally {
@@ -171,6 +172,7 @@ public abstract class Wss4jTestCase {
SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(is, null);
org.apache.axiom.soap.SOAPMessage soapMessage = builder.getSOAPMessage();
builder.detach();
return new AxiomSoapMessage(soapMessage, "", true, true);
}
finally {