//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void testRetryLoopWithFailure() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: public virtual void testRetryLoopWithFailure() { CuratorZookeeperClient client = new CuratorZookeeperClient(server.getConnectString(), 5000, 5000, null, new RetryOneTime(1)); client.start(); try { int loopCount = 0; RetryLoop retryLoop = client.newRetryLoop(); while (retryLoop.shouldContinue()) { ++loopCount; switch (loopCount) { case 1: { server.stop(); break; } case 2: { server.restart(); break; } case 3: case 4: { // ignore break; } default: { Assert.fail(); goto outerBreak; } } try { client.blockUntilConnectedOrTimedOut(); client.getZooKeeper().create("/test", new sbyte[]{1,2,3}, ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); retryLoop.markComplete(); } catch (Exception e) { retryLoop.takeException(e); } outerContinue:; } outerBreak: Assert.assertTrue(loopCount >= 2); } finally { client.close(); } }