improved test timing

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2611 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2010-12-16 10:55:25 +00:00
parent 796f444914
commit 246cde364b
2 changed files with 15 additions and 14 deletions

View File

@ -141,43 +141,43 @@ public class ResourceCacheTest
assertEquals(80,cache.getCachedSize());
assertEquals(1,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[1]);
assertEquals(90,cache.getCachedSize());
assertEquals(2,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[2]);
assertEquals(30,cache.getCachedSize());
assertEquals(2,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[3]);
assertEquals(60,cache.getCachedSize());
assertEquals(3,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[4]);
assertEquals(90,cache.getCachedSize());
assertEquals(3,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[5]);
assertEquals(90,cache.getCachedSize());
assertEquals(2,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[6]);
assertEquals(60,cache.getCachedSize());
assertEquals(1,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
FileOutputStream out = new FileOutputStream(files[6]);
out.write(' ');
@ -186,37 +186,37 @@ public class ResourceCacheTest
assertEquals(70,cache.getCachedSize());
assertEquals(1,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[6]);
assertEquals(71,cache.getCachedSize());
assertEquals(2,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[0]);
assertEquals(72,cache.getCachedSize());
assertEquals(3,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[1]);
assertEquals(82,cache.getCachedSize());
assertEquals(4,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[2]);
assertEquals(32,cache.getCachedSize());
assertEquals(4,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
content=cache.lookup(names[3]);
assertEquals(61,cache.getCachedSize());
assertEquals(4,cache.getCachedFiles());
Thread.sleep(2);
Thread.sleep(200);
cache.flushCache();
assertEquals(0,cache.getCachedSize());

View File

@ -1078,7 +1078,8 @@ public class WebAppContext extends ServletContextHandler implements WebAppClassL
try
{
dir=dir.getCanonicalFile();
if (dir!=null)
dir=dir.getCanonicalFile();
}
catch(Exception e)
{