public void HadoopFileSystemOpenFileTest() { HadoopFileSystem fileSystem = new HadoopFileSystem(this.hostname, this.portNumber, this.authentication); if (!fileSystem.IsConnected) { Assert.Inconclusive(); } if (!fileSystem.Exists(this.directoryPath + "TestFile.txt")) { Assert.Inconclusive(); } // read existing file Stream fileStream = fileSystem.OpenFile(this.directoryPath + "TestFile.txt", FileMode.Open, FileAccess.Read); fileSystem.ShouldNotBeNull(); StreamReader reader = new StreamReader(fileStream); reader.ReadToEnd().Length.ShouldBeGreaterThan(0); }