Package org.apache.commons.vfs2.impl

Examples of org.apache.commons.vfs2.impl.DefaultFileMonitor.stop()


        monitor.start();
        writeToFile(testFile);
        Thread.sleep(300);
        assertTrue("No event occurred", changeStatus != 0);
        assertTrue("Incorrect event", changeStatus == 3);
        monitor.stop();
    }

    public void testFileDeleted() throws Exception
    {
        writeToFile(testFile);
View Full Code Here


        monitor.start();
        testFile.delete();
        Thread.sleep(300);
        assertTrue("No event occurred", changeStatus != 0);
        assertTrue("Incorrect event", changeStatus == 2);
        monitor.stop();
    }

    public void testFileModified() throws Exception
    {
        writeToFile(testFile);
View Full Code Here

        boolean rc = testFile.setLastModified(value);
        assertTrue("setLastModified succeeded",rc);
        Thread.sleep(300);
        assertTrue("No event occurred", changeStatus != 0);
        assertTrue("Incorrect event", changeStatus == 1);
        monitor.stop();
    }


    public void testFileRecreated() throws Exception
    {
View Full Code Here

        monitor.addFile(fileObj);
        writeToFile(testFile);
        Thread.sleep(300);
        assertTrue("No event occurred", changeStatus != 0);
        assertTrue("Incorrect event " + changeStatus, changeStatus == 3);
        monitor.stop();
    }

    private void writeToFile(File file) throws Exception
    {
        FileWriter out = new FileWriter(file);
View Full Code Here

    this.hdfs.delete(dst, false);
    // VFS-487 significantly wait to avoid failure
    Thread.sleep(7000);
    Assert.assertTrue(listener.isFileDeleted());
   
    monitor.stop();
   
  }
 
 
  @After
View Full Code Here

   
    this.hdfs.delete(dst, false);
    Thread.sleep(2000);
    Assert.assertTrue(listener.isFileDeleted());
   
    monitor.stop();
   
  }
 
 
  @After
View Full Code Here

    this.hdfs.delete(dst, false);
    // VFS-487 significantly wait to avoid failure
    Thread.sleep(7000);
    Assert.assertTrue(listener.isFileDeleted());

    monitor.stop();

  }

  @After
  public void tearDown() throws Exception {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.