Skip to content

Commit c12ca47

Browse files
One more test
1 parent e146a5c commit c12ca47

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

projects/client/Unit/src/unit/TestConnectionRecovery.cs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,33 @@ public void TestBasicAckEventHandlerRecovery()
208208
Wait(latch);
209209
}
210210

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+
211238
[Test]
212239
public void TestExchangeRecovery()
213240
{
@@ -518,7 +545,6 @@ public void TestConsumerRecoveryWithManyConsumers()
518545
}
519546

520547
[Test]
521-
[Category("Focus")]
522548
public void TestConsumerRecoveryOnClientNamedQueueWithOneRecovery()
523549
{
524550
var c = CreateAutorecoveringConnection();
@@ -826,5 +852,14 @@ protected AutorecoveringConnection CreateAutorecoveringConnection()
826852
cf.NetworkRecoveryInterval = RECOVERY_INTERVAL;
827853
return (AutorecoveringConnection)cf.CreateConnection();
828854
}
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+
}
829864
}
830865
}

0 commit comments

Comments
 (0)