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

jaikiran do-not-reply at jboss.com
Tue Apr 14 07:42:38 EDT 2009


Yep, i have Kubuntu system where this still fails:

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.425 sec <<< FAILURE!
  | testWAR(org.jboss.test.deployers.vfs.structure.modified.test.SynchModificationTestCase)  Time elapsed: 0.121 sec  <<< FAILURE!
  | junit.framework.AssertionFailedError: Last modified diff is not bigger then 0, diff: 0
  | 	at junit.framework.Assert.fail(Assert.java:47)
  | 	at junit.framework.Assert.assertTrue(Assert.java:20)
  | 	at org.jboss.test.deployers.vfs.structure.modified.test.SynchModificationTestCase.testWAR(SynchModificationTestCase.java:122)
  | 

I see that the testcase was changed to:

assertTrue(updateFile.setLastModified(System.currentTimeMillis() + 1500l));
  | 
This probably won't introduce the "delay" that we are expecting.

Looking at this:

  | long tempTimestamp = testJsp.getLastModified();
  |          assertFalse(checker.hasStructureBeenModified(originalRoot));
  |          long lastModified = testJsp.getLastModified();

I guess, internally its a file "copy" (original deployment to temp deployment) if the original file has changed. I am not really sure whether the "copy" copies over the last modified timestamp from the source. Maybe the copy just copies the file and updates the last modified time to current system timestamp?
The delay that we need, should be between the change of the original file and  copying to temp file. Something like:


  | long tempTimestamp = testJsp.getLastModified();
  | // Platform dependent precision for last modified. Let's wait a minimum of 1 sec
  | Thread.sleep(1500);
  |          assertFalse(checker.hasStructureBeenModified(originalRoot));
  |          long lastModified = testJsp.getLastModified();


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

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



More information about the jboss-dev-forums mailing list