コード例 #1
0
        public virtual void TestDeleteFile()
        {
            Directory dir = new NRTCachingDirectory(NewDirectory(), 2.0, 25.0);

            dir.CreateOutput("foo.txt", IOContext.DEFAULT).Dispose();
            dir.DeleteFile("foo.txt");
            Assert.AreEqual(0, dir.ListAll().Length);
            dir.Dispose();
        }
コード例 #2
0
        public virtual void TestDirectoryFilter()
        {
            Directory dir  = new NRTCachingDirectory(NewFSDirectory(CreateTempDir("foo")), 2.0, 25.0);
            string    name = "file";

            try
            {
                dir.CreateOutput(name, NewIOContext(Random)).Dispose();
                Assert.IsTrue(SlowFileExists(dir, name));
                Assert.IsTrue(ContainsFile(dir, name));
            }
            finally
            {
                dir.Dispose();
            }
        }
コード例 #3
0
 public virtual void TestDirectoryFilter()
 {
     Directory dir = new NRTCachingDirectory(NewFSDirectory(CreateTempDir("foo")), 2.0, 25.0);
     string name = "file";
     try
     {
         dir.CreateOutput(name, NewIOContext(Random())).Dispose();
         Assert.IsTrue(SlowFileExists(dir, name));
         Assert.IsTrue(Arrays.AsList(dir.ListAll()).Contains(name));
     }
     finally
     {
         dir.Dispose();
     }
 }
コード例 #4
0
 public virtual void TestDeleteFile()
 {
     Directory dir = new NRTCachingDirectory(NewDirectory(), 2.0, 25.0);
     dir.CreateOutput("foo.txt", IOContext.DEFAULT).Dispose();
     dir.DeleteFile("foo.txt");
     Assert.AreEqual(0, dir.ListAll().Length);
     dir.Dispose();
 }