public void TestResourceHolder()
        {
            var h1 = new RabbitResourceHolder();
            var h2 = new RabbitResourceHolder();
            var connectionFactory = new Mock <IConnectionFactory>();

            TransactionSynchronizationManager.SetActualTransactionActive(true);
            ConnectionFactoryUtils.BindResourceToTransaction(h1, connectionFactory.Object, true);
            Assert.Same(h1, ConnectionFactoryUtils.BindResourceToTransaction(h2, connectionFactory.Object, true));
            TransactionSynchronizationManager.Clear();
        }
Exemple #2
0
 protected override void ReleaseResource(RabbitResourceHolder resourceHolder, object resourceKey)
 {
     ConnectionFactoryUtils.ReleaseResources(resourceHolder);
 }
Exemple #3
0
 public IConnection CreateConnection2()
 {
     return(ConnectionFactoryUtils.CreateConnection(ConnectionFactory, PublisherConnectionIfPossible));
 }
Exemple #4
0
 protected virtual RabbitResourceHolder GetTransactionalResourceHolder()
 {
     return(ConnectionFactoryUtils.GetTransactionalResourceHolder(ConnectionFactory, IsChannelTransacted));
 }