@Test public void testNotification() throws Exception {
XAConnectionImpl xaConn = new XAConnectionImpl(new XAConnectionImpl.ConnectionSource() {
@Override
public ConnectionImpl createConnection() throws SQLException {
ConnectionImpl c = Mockito.mock(ConnectionImpl.class);
Mockito.doThrow(new SQLException(new InvalidSessionException())).when(c).commit();
return c;
}
});
ConnectionEventListener cel = Mockito.mock(ConnectionEventListener.class);
xaConn.addConnectionEventListener(cel);