https://issues.apache.org/jira/browse/AMQ-5568 - verify delete return code for win platform failure. Thanks to Erik Wramner for the heads up

This commit is contained in:
gtully 2015-09-22 12:56:13 +01:00
parent c08efbe6c2
commit 86c826c461
1 changed files with 8 additions and 6 deletions

View File

@ -35,16 +35,18 @@ public class LockFileTest {
underTest.lock();
lockFile.delete();
// will fail on windows b/c the file is open
if ( lockFile.delete() ) {
assertFalse("no longer valid", underTest.keepAlive());
assertFalse("no longer valid", underTest.keepAlive());
// a slave gets in
lockFile.createNewFile();
// a slave gets in
lockFile.createNewFile();
underTest.unlock();
underTest.unlock();
assertTrue("file still exists after unlock when not locked", lockFile.exists());
assertTrue("file still exists after unlock when not locked", lockFile.exists());
}
}