assertEquals("XAResource should know 0 xid", 0, mockXAResource.getKnownXids().size());
assertNull("Should not be committed", mockXAResource.getCommitted());
}
public void testOneTransactionTwoCalls() throws Throwable {
TransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
defaultComponentInterceptor.invoke(defaultComponentContext);
MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
assertNull("Should not be committed", mockXAResource.getCommitted());
defaultComponentInterceptor.invoke(defaultComponentContext);
assertEquals("Expected same XAResource", mockXAResource, mockManagedConnection.getXAResource());
assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
assertNull("Should not be committed", mockXAResource.getCommitted());
transactionContext.commit();
assertNotNull("Should be committed", mockXAResource.getCommitted());
}