@@ -208,6 +208,33 @@ public void TestBasicAckEventHandlerRecovery()
208
208
Wait ( latch ) ;
209
209
}
210
210
211
+ [ Test ]
212
+ public void TestRecoveryWithTopologyDisabled ( )
213
+ {
214
+ AutorecoveringConnection conn = CreateAutorecoveringConnectionWithTopologyRecoveryDisabled ( ) ;
215
+ IModel ch = conn . CreateModel ( ) ;
216
+ string s = "dotnet-client.test.recovery.q2" ;
217
+ ch . QueueDelete ( s ) ;
218
+ ch . QueueDeclare ( s , false , true , false , null ) ;
219
+ ch . QueueDeclarePassive ( s ) ;
220
+ Assert . IsTrue ( ch . IsOpen ) ;
221
+
222
+ try
223
+ {
224
+ CloseAndWaitForRecovery ( conn ) ;
225
+ Assert . IsTrue ( ch . IsOpen ) ;
226
+ ch . QueueDeclarePassive ( s ) ;
227
+ Assert . Fail ( "Expected an exception" ) ;
228
+ } catch ( OperationInterruptedException e )
229
+ {
230
+ // expected
231
+ } finally
232
+ {
233
+ conn . Abort ( ) ;
234
+ }
235
+ }
236
+
237
+
211
238
[ Test ]
212
239
public void TestExchangeRecovery ( )
213
240
{
@@ -518,7 +545,6 @@ public void TestConsumerRecoveryWithManyConsumers()
518
545
}
519
546
520
547
[ Test ]
521
- [ Category ( "Focus" ) ]
522
548
public void TestConsumerRecoveryOnClientNamedQueueWithOneRecovery ( )
523
549
{
524
550
var c = CreateAutorecoveringConnection ( ) ;
@@ -826,5 +852,14 @@ protected AutorecoveringConnection CreateAutorecoveringConnection()
826
852
cf . NetworkRecoveryInterval = RECOVERY_INTERVAL ;
827
853
return ( AutorecoveringConnection ) cf . CreateConnection ( ) ;
828
854
}
855
+
856
+ protected AutorecoveringConnection CreateAutorecoveringConnectionWithTopologyRecoveryDisabled ( )
857
+ {
858
+ var cf = new ConnectionFactory ( ) ;
859
+ cf . AutomaticRecoveryEnabled = true ;
860
+ cf . TopologyRecoveryEnabled = false ;
861
+ cf . NetworkRecoveryInterval = RECOVERY_INTERVAL ;
862
+ return ( AutorecoveringConnection ) cf . CreateConnection ( ) ;
863
+ }
829
864
}
830
865
}
0 commit comments