Skip to content

Commit

Permalink
PAYARA-2356-increase-delay-on-secret-dir-test (#2229) (#2262)
Browse files Browse the repository at this point in the history
* PAYARA-2356-increase-delay-on-secret-dir-test

* PAYARA-2356-increase-delay-on-secret-dir-test
manually updating the last modification time
  • Loading branch information
mulderbaba authored and smillidge committed Jan 15, 2018
1 parent 28b69f4 commit b9add8a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
Expand Down Expand Up @@ -152,9 +155,10 @@ public void testChangeProperty() throws IOException, InterruptedException {
assertEquals("value1", value);
// change the file
Path file1 = Paths.get(testDirectory.toString(), "property1");
Thread.sleep(100);
System.out.println("Test measured last modified time before write " + Files.getLastModifiedTime(file1));
Files.write(file1, "value-changed".getBytes());
FileTime nowplus1sec = FileTime.fromMillis(System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(1));
Files.setLastModifiedTime(file1, nowplus1sec);
System.out.println("Test measured last modified time after write" + Files.getLastModifiedTime(file1));
value = instance.getValue("property1");
assertEquals("value-changed", value);
Expand Down

0 comments on commit b9add8a

Please sign in to comment.