use of org.teiid.client.xa.XidImpl in project teiid by teiid.
the class TestXAConnection method testConnectionClose.
@Test
public void testConnectionClose() throws Exception {
final ConnectionImpl mmConn = TestConnection.getMMConnection();
XAConnectionImpl xaConn = new XAConnectionImpl(mmConn);
Connection conn = xaConn.getConnection();
StatementImpl stmt = (StatementImpl) conn.createStatement();
conn.setAutoCommit(false);
conn.close();
ServerConnection sc = xaConn.getConnectionImpl().getServerConnection();
Mockito.verify(sc, VerificationModeFactory.times(1)).cleanUp();
assertTrue(stmt.isClosed());
assertTrue(conn.getAutoCommit());
conn = xaConn.getConnection();
stmt = (StatementImpl) conn.createStatement();
XAResource resource = xaConn.getXAResource();
resource.start(new XidImpl(1, new byte[0], new byte[0]), XAResource.TMNOFLAGS);
conn.close();
assertTrue(stmt.isClosed());
assertTrue(conn.getAutoCommit());
}
use of org.teiid.client.xa.XidImpl in project teiid by teiid.
the class TestMMXid method testCopyConstructor.
public void testCopyConstructor() {
XidImpl xidcopy = new XidImpl(XID1);
assertEquals(XID1Copy, xidcopy);
assertNotSame(XID1Copy, xidcopy);
}
Aggregations