XAExceptionFactory extends AbstractExceptionFactory<XAException> { @Override public XAException createException(String message) { return new XAException(message); } XAExceptionFactory(); @Override XAException createException(String message); @Override boolean equals(XAException exception1, XAException exception2); @Override boolean indicatesFailure(XAException exception, Dialect dialect); @Override ExceptionType getType(); @Override boolean correctHeuristic(XAException exception, Phase phase);  }
@Test public void createExceptionFromMessage() { String message = "message"; XAException result = this.factory.createException(message); assertSame(message, result.getMessage()); assertNull(result.getCause()); }
@Test public void createExceptionFromException() { String message = "message"; Exception exception = new Exception("message"); XAException result = this.factory.createException(exception); assertNotNull(result.getMessage()); assertSame(message, result.getMessage()); assertSame(exception, result.getCause()); }
@Test public void createExceptionFromXAException() { XAException exception = new XAException(); XAException result = this.factory.createException(exception); assertSame(exception, result); }