Repository: activemq Updated Branches: refs/heads/master c08efbe6c -> 86c826c46
https://issues.apache.org/jira/browse/AMQ-5568 - verify delete return code for win platform failure. Thanks to Erik Wramner for the heads up Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/86c826c4 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/86c826c4 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/86c826c4 Branch: refs/heads/master Commit: 86c826c4615d5f4d90cc3f75fef845640369458d Parents: c08efbe Author: gtully <[email protected]> Authored: Tue Sep 22 12:56:13 2015 +0100 Committer: gtully <[email protected]> Committed: Tue Sep 22 12:56:13 2015 +0100 ---------------------------------------------------------------------- .../java/org/apache/activemq/util/LockFileTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/86c826c4/activemq-broker/src/test/java/org/apache/activemq/util/LockFileTest.java ---------------------------------------------------------------------- diff --git a/activemq-broker/src/test/java/org/apache/activemq/util/LockFileTest.java b/activemq-broker/src/test/java/org/apache/activemq/util/LockFileTest.java index 30d9172..0e4c23d 100644 --- a/activemq-broker/src/test/java/org/apache/activemq/util/LockFileTest.java +++ b/activemq-broker/src/test/java/org/apache/activemq/util/LockFileTest.java @@ -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()); + } }
