public virtual void TestAppend() { string src = "/testNamenodeRetryCache/testAppend/src"; ResetCall(); // Create a file with partial block DFSTestUtil.CreateFile(filesystem, new Path(src), 128, (short)1, 0L); // Retried append requests succeed NewCall(); LastBlockWithStatus b = nnRpc.Append(src, "holder", new EnumSetWritable <CreateFlag >(EnumSet.Of(CreateFlag.Append))); NUnit.Framework.Assert.AreEqual(b, nnRpc.Append(src, "holder", new EnumSetWritable <CreateFlag>(EnumSet.Of(CreateFlag.Append)))); NUnit.Framework.Assert.AreEqual(b, nnRpc.Append(src, "holder", new EnumSetWritable <CreateFlag>(EnumSet.Of(CreateFlag.Append)))); // non-retried call fails NewCall(); try { nnRpc.Append(src, "holder", new EnumSetWritable <CreateFlag>(EnumSet.Of(CreateFlag .Append))); NUnit.Framework.Assert.Fail("testAppend - expected exception is not thrown"); } catch (Exception) { } }