From f36e8ca50cdabb056082b1233d722c7ace55704c Mon Sep 17 00:00:00 2001 From: Andreas Veithen Date: Mon, 22 May 2017 22:10:21 +0100 Subject: [PATCH] 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. --- .../springframework/ws/soap/security/wss4j2/Wss4jTestCase.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jTestCase.java b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jTestCase.java index 12668289..9df9ad7c 100644 --- a/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jTestCase.java +++ b/spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jTestCase.java @@ -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 {