Search in sources :

Example 21 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testAbort.

@Test
public void testAbort() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.abort(x -> {
    });
    Mockito.verify(conn, Mockito.times(0)).abort(Mockito.any(Executor.class));
}
Also used : Executor(java.util.concurrent.Executor) TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 22 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testAutoCommit.

@Test(expected = TransactionException.class)
public void testAutoCommit() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.setAutoCommit(true);
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 23 with TxConnectionWrapper

use of org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper in project aries by apache.

the class TxConnectionWrapperTest method testCommit.

@Test(expected = TransactionException.class)
public void testCommit() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.commit();
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Aggregations

Connection (java.sql.Connection)23 TxConnectionWrapper (org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper)23 Test (org.junit.Test)21 SQLException (java.sql.SQLException)2 ScopedConnectionWrapper (org.apache.aries.tx.control.jdbc.common.impl.ScopedConnectionWrapper)2 TransactionContext (org.osgi.service.transaction.control.TransactionContext)2 TransactionException (org.osgi.service.transaction.control.TransactionException)2 Executor (java.util.concurrent.Executor)1