public virtual void TestListStatusNestedNonRecursive() { Configuration conf = new Configuration(); conf.SetInt(FileInputFormat.ListStatusNumThreads, numThreads); IList <Path> expectedPaths = ConfigureTestNestedNonRecursive(conf, localFs); Job job = Job.GetInstance(conf); FileInputFormat <object, object> fif = new TextInputFormat(); IList <FileStatus> statuses = fif.ListStatus(job); VerifyFileStatuses(expectedPaths, statuses, localFs); }
public virtual void TestListStatusErrorOnNonExistantDir() { Configuration conf = new Configuration(); conf.SetInt(FileInputFormat.ListStatusNumThreads, numThreads); ConfigureTestErrorOnNonExistantDir(conf, localFs); Job job = Job.GetInstance(conf); FileInputFormat <object, object> fif = new TextInputFormat(); try { fif.ListStatus(job); NUnit.Framework.Assert.Fail("Expecting an IOException for a missing Input path"); } catch (IOException e) { Path expectedExceptionPath = new Path(TestRootDir, "input2"); expectedExceptionPath = localFs.MakeQualified(expectedExceptionPath); NUnit.Framework.Assert.IsTrue(e is InvalidInputException); NUnit.Framework.Assert.AreEqual("Input path does not exist: " + expectedExceptionPath .ToString(), e.Message); } }