public virtual void TestConcatFileOnFile() { byte[] block = ContractTestUtils.Dataset(TestFileLen, 0, 255); ContractTestUtils.CreateFile(GetFileSystem(), target, false, block); GetFileSystem().Concat(target, new Path[] { srcFile }); ContractTestUtils.AssertFileHasLength(GetFileSystem(), target, TestFileLen * 2); ContractTestUtils.ValidateFileContent(ContractTestUtils.ReadDataset(GetFileSystem (), target, TestFileLen * 2), new byte[][] { block, block }); }
public virtual void TestAppendToExistingFile() { byte[] original = ContractTestUtils.Dataset(8192, 'A', 'Z'); byte[] appended = ContractTestUtils.Dataset(8192, '0', '9'); ContractTestUtils.CreateFile(GetFileSystem(), target, false, original); FSDataOutputStream outputStream = GetFileSystem().Append(target); outputStream.Write(appended); outputStream.Close(); byte[] bytes = ContractTestUtils.ReadDataset(GetFileSystem(), target, original.Length + appended.Length); ContractTestUtils.ValidateFileContent(bytes, new byte[][] { original, appended }); }