|
|
|
|
@ -48,18 +48,8 @@ import org.springframework.transaction.support.TransactionSynchronizationAdapter
@@ -48,18 +48,8 @@ import org.springframework.transaction.support.TransactionSynchronizationAdapter
|
|
|
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager; |
|
|
|
|
import org.springframework.transaction.support.TransactionTemplate; |
|
|
|
|
|
|
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
import static org.junit.Assert.assertFalse; |
|
|
|
|
import static org.junit.Assert.assertNull; |
|
|
|
|
import static org.junit.Assert.assertSame; |
|
|
|
|
import static org.junit.Assert.assertTrue; |
|
|
|
|
import static org.junit.Assert.fail; |
|
|
|
|
import static org.mockito.BDDMockito.given; |
|
|
|
|
import static org.mockito.BDDMockito.inOrder; |
|
|
|
|
import static org.mockito.BDDMockito.mock; |
|
|
|
|
import static org.mockito.BDDMockito.times; |
|
|
|
|
import static org.mockito.BDDMockito.verify; |
|
|
|
|
import static org.mockito.BDDMockito.willThrow; |
|
|
|
|
import static org.junit.Assert.*; |
|
|
|
|
import static org.mockito.BDDMockito.*; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author Juergen Hoeller |
|
|
|
|
@ -225,7 +215,7 @@ public class DataSourceTransactionManagerTests {
@@ -225,7 +215,7 @@ public class DataSourceTransactionManagerTests {
|
|
|
|
|
|
|
|
|
|
final DataSource dsToUse = (lazyConnection ? new LazyConnectionDataSourceProxy(ds) : ds); |
|
|
|
|
tm = new DataSourceTransactionManager(dsToUse); |
|
|
|
|
TransactionTemplate tt = new TransactionTemplate(tm); |
|
|
|
|
TransactionTemplate tt = new TransactionTemplate(tm); |
|
|
|
|
assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(dsToUse)); |
|
|
|
|
assertTrue("Synchronization not active", !TransactionSynchronizationManager.isSynchronizationActive()); |
|
|
|
|
|
|
|
|
|
@ -1259,7 +1249,8 @@ public class DataSourceTransactionManagerTests {
@@ -1259,7 +1249,8 @@ public class DataSourceTransactionManagerTests {
|
|
|
|
|
assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test public void testTransactionWithPropagationNotSupported() throws Exception { |
|
|
|
|
@Test |
|
|
|
|
public void testTransactionWithPropagationNotSupported() throws Exception { |
|
|
|
|
TransactionTemplate tt = new TransactionTemplate(tm); |
|
|
|
|
tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_NOT_SUPPORTED); |
|
|
|
|
assertTrue("Hasn't thread connection", !TransactionSynchronizationManager.hasResource(ds)); |
|
|
|
|
|