Skip to content

Commit f36e8ca

Browse files
veithengregturn
authored andcommitted
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.
1 parent 8c3df71 commit f36e8ca

File tree

1 file changed

+2
-0
lines changed
  • spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2

1 file changed

+2
-0
lines changed

spring-ws-security/src/test/java/org/springframework/ws/soap/security/wss4j2/Wss4jTestCase.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ protected AxiomSoapMessage loadAxiom11Message(String fileName) throws Exception
154154

155155
SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(is, null);
156156
org.apache.axiom.soap.SOAPMessage soapMessage = builder.getSOAPMessage();
157+
builder.detach();
157158
return new AxiomSoapMessage(soapMessage, "", true, true);
158159
}
159160
finally {
@@ -171,6 +172,7 @@ protected AxiomSoapMessage loadAxiom12Message(String fileName) throws Exception
171172

172173
SOAPModelBuilder builder = OMXMLBuilderFactory.createSOAPModelBuilder(is, null);
173174
org.apache.axiom.soap.SOAPMessage soapMessage = builder.getSOAPMessage();
175+
builder.detach();
174176
return new AxiomSoapMessage(soapMessage, "", true, true);
175177
}
176178
finally {

0 commit comments

Comments
 (0)