use of javax.resource.spi.ConnectionEvent in project cxf by apache.
the class AbstractManagedConnectionImpl method close.
public void close(Object closingHandle) throws ResourceException {
LOG.fine("Closing handle: " + closingHandle);
ConnectionEvent coEvent = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
coEvent.setConnectionHandle(closingHandle);
sendEvent(coEvent);
}
use of javax.resource.spi.ConnectionEvent in project cxf by apache.
the class ManagedConnectionImplTest method testSendEventError.
@Test
public void testSendEventError() throws Exception {
ConnectionEvent event = new ConnectionEvent(mc, ConnectionEvent.CONNECTION_ERROR_OCCURRED);
ConnectionEventListener listener = EasyMock.createMock(ConnectionEventListener.class);
mc.addConnectionEventListener(listener);
listener.connectionErrorOccurred(EasyMock.isA(ConnectionEvent.class));
EasyMock.expectLastCall();
EasyMock.replay(listener);
mc.sendEvent(event);
EasyMock.verify(listener);
}
use of javax.resource.spi.ConnectionEvent in project cxf by apache.
the class ManagedConnectionImplTest method testSendEventTxRolledBack.
@Test
public void testSendEventTxRolledBack() throws Exception {
ConnectionEvent event = new ConnectionEvent(mc, ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK);
ConnectionEventListener listener = EasyMock.createMock(ConnectionEventListener.class);
mc.addConnectionEventListener(listener);
EasyMock.reset(listener);
listener.localTransactionRolledback(EasyMock.isA(ConnectionEvent.class));
EasyMock.expectLastCall();
EasyMock.replay(listener);
mc.sendEvent(event);
}
use of javax.resource.spi.ConnectionEvent in project cxf by apache.
the class ManagedConnectionImplTest method testSendEventTxCommitted.
@Test
public void testSendEventTxCommitted() throws Exception {
ConnectionEvent event = new ConnectionEvent(mc, ConnectionEvent.LOCAL_TRANSACTION_COMMITTED);
ConnectionEventListener listener = EasyMock.createMock(ConnectionEventListener.class);
mc.addConnectionEventListener(listener);
listener.localTransactionCommitted(EasyMock.isA(ConnectionEvent.class));
EasyMock.expectLastCall();
EasyMock.replay(listener);
mc.sendEvent(event);
EasyMock.verify(listener);
}
Aggregations