342161 - ScannerTest fails intermittently on Mac OS X

+ changing test directory to use test specific directory to avoid
  conflicts with /tmp directory reuse amoung other tests.
This commit is contained in:
Joakim Erdfelt 2011-09-13 11:48:16 -07:00
parent 61eba95ac6
commit 82f48ada9a
1 changed files with 7 additions and 7 deletions

View File

@ -7,6 +7,8 @@ import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.util.Scanner.Notification;
import org.junit.AfterClass;
@ -25,10 +27,8 @@ public class ScannerTest
@BeforeClass
public static void setUpBeforeClass() throws Exception
{
_directory = File.createTempFile("scan","");
_directory.delete();
_directory.mkdir();
_directory.deleteOnExit();
_directory = MavenTestingUtils.getTargetTestingDir(ScannerTest.class.getSimpleName());
FS.ensureEmpty(_directory);
_scanner = new Scanner();
_scanner.addScanDir(_directory);
@ -88,7 +88,7 @@ public class ScannerTest
public void testAddedChangeRemove() throws Exception
{
// TODO needs to be further investigated
Assume.assumeTrue(!OS.IS_WINDOWS && !OS.IS_OSX);
Assume.assumeTrue(!OS.IS_WINDOWS);
touch("a0");
@ -96,7 +96,7 @@ public class ScannerTest
_scanner.scan();
_scanner.scan();
Event event = _queue.poll();
Assert.assertTrue(event!=null);
Assert.assertNotNull("Event should not be null", event);
Assert.assertEquals(_directory+"/a0",event._filename);
Assert.assertEquals(Notification.ADDED,event._notification);
@ -197,7 +197,7 @@ public class ScannerTest
public void testSizeChange() throws Exception
{
// TODO needs to be further investigated
Assume.assumeTrue(!OS.IS_WINDOWS && !OS.IS_OSX);
Assume.assumeTrue(!OS.IS_WINDOWS);
touch("tsc0");
_scanner.scan();