Package org.bladerunnerjs.utility.filemodification

Examples of org.bladerunnerjs.utility.filemodification.FileModifiedChecker


    FileModificationInfo fileModificationInfo = fileModificationService.getFileModificationInfo(new File(tempDir,  filePath));
    watches.put(filePath, new InfoFileModifiedChecker(fileModificationInfo));
  }
 
  private void waitForChange(String filePath) throws InterruptedException {
    FileModifiedChecker fileModifiedChecker = watches.get(filePath);
    long startTime = new Date().getTime();
   
    while(!fileModifiedChecker.hasChangedSinceLastCheck()) {
      long elapsedTime = new Date().getTime() - startTime;
      if(elapsedTime > 5000) {
        fail("Timeout: no change detected after 5 seconds.");
      }
     
View Full Code Here


  public void switchingToANewFileModificationServiceDoesntBreakExistingFileModifiedCheckers() {
    File someDir = new File(tmpDir, "temp");
    someDir.mkdir();
   
    BRJSFileInfo brjsFileInfo = new BRJSFileInfo(someDir, fileModificationService, null, null);
    FileModifiedChecker fileModifiedChecker = new InfoFileModifiedChecker(brjsFileInfo);
   
    assertTrue(fileModifiedChecker.hasChangedSinceLastCheck());
    assertTrue(fileModifiedChecker.hasChangedSinceLastCheck());
   
    brjsFileInfo.reset(fileModificationService);
   
    assertTrue(fileModifiedChecker.hasChangedSinceLastCheck());
    assertTrue(fileModifiedChecker.hasChangedSinceLastCheck());
  }
View Full Code Here

TOP

Related Classes of org.bladerunnerjs.utility.filemodification.FileModifiedChecker

Copyright © 2018 www.massapicom. 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.