Message message = new Message(SOAP_MESSAGE);
MessageContext context = new MessageContext(server);
context.setSOAPConstants(SOAPConstants.SOAP12_CONSTANTS);
message.setMessageContext(context);
boolean expectedExceptionThrown = false;
try {
SOAPEnvelope envelope = message.getSOAPEnvelope();
} catch (AxisFault af) {
if (Constants.FAULT_VERSIONMISMATCH.equals(af.getFaultCode()))
expectedExceptionThrown = true;
}
assertTrue(expectedExceptionThrown);