Search in sources :

Example 21 with ConnectionEventListener

use of javax.resource.spi.ConnectionEventListener 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);
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener) Test(org.junit.Test)

Example 22 with ConnectionEventListener

use of javax.resource.spi.ConnectionEventListener 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);
}
Also used : ConnectionEvent(javax.resource.spi.ConnectionEvent) ConnectionEventListener(javax.resource.spi.ConnectionEventListener) Test(org.junit.Test)

Aggregations

ConnectionEvent (javax.resource.spi.ConnectionEvent)22 ConnectionEventListener (javax.resource.spi.ConnectionEventListener)22 Test (org.junit.Test)7 BadConnectionEventListener (com.sun.appserv.connectors.internal.spi.BadConnectionEventListener)1 NotSupportedException (javax.resource.NotSupportedException)1 GFConnectionImpl (org.apache.geode.internal.ra.GFConnectionImpl)1