Search in sources :

Example 6 with TxConnectionWrapper

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

the class TxConnectionWrapperTest method testRollbackSavepoint.

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

Example 7 with TxConnectionWrapper

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

the class TxConnectionWrapperTest method testSetReadOnly.

@Test
public void testSetReadOnly() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.setReadOnly(true);
    Mockito.verify(conn).setReadOnly(true);
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 8 with TxConnectionWrapper

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

the class TxConnectionWrapperTest method testPrepareCall.

@Test
public void testPrepareCall() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.prepareCall("foo");
    Mockito.verify(conn).prepareCall("foo");
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 9 with TxConnectionWrapper

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

the class TxConnectionWrapperTest method testTransactionIsolation.

@Test
public void testTransactionIsolation() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.setTransactionIsolation(1);
    Mockito.verify(conn).setTransactionIsolation(1);
}
Also used : TxConnectionWrapper(org.apache.aries.tx.control.jdbc.common.impl.TxConnectionWrapper) Connection(java.sql.Connection) Test(org.junit.Test)

Example 10 with TxConnectionWrapper

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

the class TxConnectionWrapperTest method testReleaseSavepoint.

@Test(expected = TransactionException.class)
public void testReleaseSavepoint() throws SQLException {
    Connection wrapped = new TxConnectionWrapper(conn);
    wrapped.releaseSavepoint(null);
}
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