Examples of XAConnectionCloseEvent


Examples of bitronix.tm.mock.events.XAConnectionCloseEvent

        final XAConnection mockXAConnection = mock(XAConnection.class);
        // Handle XAConnection.close(), first time we answer, after that we throw
        doAnswer(new Answer<Object>() {
      public Object answer(InvocationOnMock invocation) throws Throwable {
        EventRecorder eventRecorder = EventRecorder.getEventRecorder(mockXAConnection);
        eventRecorder.addEvent(new XAConnectionCloseEvent(mockXAConnection));
        return null;
      }
    }).doThrow(new SQLException("XAConnection is already closed")).when(mockXAConnection).close();

        when(mockXAConnection.getXAResource()).thenReturn(xaResource);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.