You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/09/26 19:13:04 UTC
[commons-vfs] branch master updated: Reuse constant.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push:
new 7d200c3 Reuse constant.
7d200c3 is described below
commit 7d200c3ae2e3cb904500930d671c29a465fb60d4
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Sep 26 15:12:59 2020 -0400
Reuse constant.
---
.../vfs2/impl/test/DefaultFileMonitorTest.java | 34 +++++++++++-----------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTest.java
index 9d66ca7..6d05c17 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/impl/test/DefaultFileMonitorTest.java
@@ -73,7 +73,7 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.start();
try {
writeToFile(testFile);
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event", Status.CREATED, changeStatus);
} finally {
@@ -112,11 +112,11 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
try {
// Need a long delay to insure the new timestamp doesn't truncate to be the same as
// the current timestammp. Java only guarantees the timestamp will be to 1 second.
- Thread.sleep(1000);
+ Thread.sleep(DELAY_MILLIS * 10);
final long value = System.currentTimeMillis();
final boolean rc = testFile.setLastModified(value);
assertTrue("setLastModified succeeded", rc);
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event", Status.CHANGED, changeStatus);
} finally {
@@ -134,19 +134,19 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.start();
try {
writeToFile(testFile);
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event " + changeStatus, Status.CREATED, changeStatus);
changeStatus = null;
testFile.delete();
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event " + changeStatus, Status.DELETED, changeStatus);
changeStatus = null;
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
monitor.addFile(fileObject);
writeToFile(testFile);
- Thread.sleep(1000);
+ Thread.sleep(DELAY_MILLIS * 10);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event " + changeStatus, Status.CREATED, changeStatus);
} finally {
@@ -165,15 +165,15 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.start();
try {
changeStatus = null;
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
testFile.delete();
- Thread.sleep(3000);
+ Thread.sleep(DELAY_MILLIS * 30);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event " + changeStatus, Status.DELETED, changeStatus);
changeStatus = null;
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
writeToFile(testFile);
- Thread.sleep(3000);
+ Thread.sleep(DELAY_MILLIS * 30);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event " + changeStatus, Status.CREATED, changeStatus);
} finally {
@@ -192,9 +192,9 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.start();
try {
changeStatus = null;
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
testFile.delete();
- Thread.sleep(3000);
+ Thread.sleep(DELAY_MILLIS * 30);
assertEquals("Event should not have occurred", null, changeStatus);
} finally {
monitor.stop();
@@ -212,7 +212,7 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.start();
try {
writeToFile(testFile);
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
} finally {
monitor.stop();
}
@@ -220,7 +220,7 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.start();
try {
testFile.delete();
- Thread.sleep(500);
+ Thread.sleep(DELAY_MILLIS * 5);
assertTrue("No event occurred", changeStatus != null);
assertEquals("Incorrect event", Status.DELETED, changeStatus);
} finally {
@@ -246,7 +246,7 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
monitor.addFile(fileObject);
monitor.start();
writeToFile(testFile);
- Thread.sleep(300);
+ Thread.sleep(DELAY_MILLIS * 3);
assertEquals("Created event is only fired once", 1, listener.created.get());
} finally {
monitor.stop();
@@ -292,7 +292,7 @@ public class DefaultFileMonitorTest extends AbstractVfsTestCase {
activeMonitor.start();
try {
writeToFile(testFile);
- Thread.sleep(1000);
+ Thread.sleep(DELAY_MILLIS * 10);
assertEquals("The listener of the active monitor received one created event", 1,
activeListener.created.get());