[jboss-dev-forums] [Design the new POJO MicroContainer] - File last modified diff behavior

alesj do-not-reply at jboss.com
Mon Apr 13 06:51:19 EDT 2009


I have this piece of test code

  |          // update some file
  |          File updateFile = new File(rootFile, "test.jsp");
  |          assertTrue(updateFile.exists());
  |          assertTrue(updateFile.setLastModified(System.currentTimeMillis()));
  |          @SuppressWarnings("deprecation")
  |          VirtualFile testJsp = tempRoot.findChild("test.jsp");
  |          long tempTimestamp = testJsp.getLastModified();
  |          // this should override tempJsp, hence new timestamp
  |          assertFalse(checker.hasStructureBeenModified(originalRoot));
  |          long lastModified = testJsp.getLastModified();
  |          long diff = lastModified - tempTimestamp;
  |          assertTrue("Last modified diff is not bigger then 0, diff: " + diff, diff > 0);
  | 

While this work for me locally (winz machine), it fails for me remotely (linux machine).

This test mocks the behavior for JBAS-6722,
where the user updates his original file (updateFile),
and then the checker updates (overrides) the temp copy (tempJsp).

Any idea why this would diff based on OS?


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225090#4225090

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225090



More information about the jboss-dev-forums mailing list