InputStream is = getClass().getResourceAsStream("resources/NoSuchCodeDocLiteral.xml");
SOAPMessage faultMsg = binding.getMessageFactory().createMessage(null, is);
soapContext.setMessage(faultMsg);
binding.unmarshalFault(soapContext, objContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.PARTS,
null));
assertNotNull(objContext.getException());
Object faultEx = objContext.getException();
assertTrue(NoSuchCodeLitFault.class.isAssignableFrom(faultEx.getClass()));
NoSuchCodeLitFault nscf = (NoSuchCodeLitFault)faultEx;
assertNotNull(nscf.getFaultInfo());
NoSuchCodeLit faultInfo = nscf.getFaultInfo();
assertNotNull(faultInfo.getCode());
ErrorCode ec = faultInfo.getCode();
assertEquals(ec.getMajor(), (short)666);
assertEquals(ec.getMinor(), (short)999);
assertEquals(nscf.getMessage(), "Test Exception");
is = getClass().getResourceAsStream("resources/BadRecordDocLiteral.xml");
faultMsg = binding.getMessageFactory().createMessage(null, is);
soapContext.setMessage(faultMsg);
binding.unmarshalFault(soapContext, objContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.PARTS,
null));
assertNotNull(objContext.getException());
faultEx = objContext.getException();
assertTrue(BadRecordLitFault.class.isAssignableFrom(faultEx.getClass()));
BadRecordLitFault brlf = (BadRecordLitFault)faultEx;
assertEquals(brlf.getFaultInfo(), "BadRecordTested");
is = getClass().getResourceAsStream("resources/SystemFault.xml");
faultMsg = binding.getMessageFactory().createMessage(null, is);
soapContext.setMessage(faultMsg);
binding.unmarshalFault(soapContext, objContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.PARTS,
null));
assertNotNull(objContext.getException());
faultEx = objContext.getException();
assertTrue("Should be a SOAPFaultException",