summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-06-13 02:44:31 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-06-13 02:44:31 +0200
commitd189309cdc0393e57deb48c1f3a211d3515ed952 (patch)
tree360cfa524767d30d8f2ac401e9c6f1f44f95371b /org.eclipse.jgit.junit
parent1cfcde48534dcc9510e6e58d422a78fcd156c85f (diff)
parentf3b7c2beaebfe3a68b51df74e8ae5183f08a55b3 (diff)
downloadjgit-d189309cdc0393e57deb48c1f3a211d3515ed952.tar.gz
jgit-d189309cdc0393e57deb48c1f3a211d3515ed952.zip
Merge branch 'stable-5.4'
* stable-5.4: Prepare 5.4.1-SNAPSHOT builds JGit v5.4.0.201906121030-r JGit v5.4.0.201906120450-r Increase severity of OperatorPrecedence to ERROR, and fix instances PackWriter: Make internal class static Prepare 5.3.3-SNAPSHOT builds JGit v5.3.2.201906051522-r Prepare 5.1.9-SNAPSHOT builds JGit v5.1.8.201906050907-r Test detecting modified packfiles Enhance fsTick() to use filesystem timer resolution Add debug trace to measure time needed to open pack index Extend FileSnapshot for packfiles to also use checksum to detect changes Wait opening new packfile until it can't be racy anymore Avoid null PackConfig in GC Add FileSnapshot test testing recognition of file size changes Capture reason for result of FileSnapshot#isModified Skip FileSnapshotTest#testSimulatePackfileReplacement on Windows Tune max heap size for tests Fix FileSnapshotTest.testNewFileNoWait() to match its javadoc ObjectDirectory: fix closing of obsolete packs Update API filters for methods added to fix bugs Bazel: Increase severity of most error-prone checks to ERROR Enable error-prone checks by default Add bazel options to align with gerrit's Include filekey file attribute when comparing FileSnapshots Measure file timestamp resolution used in FileSnapshot Fix FileSnapshot's consideration of file size Fix API problem filters Fix API problem filters Change-Id: I4abbaaf79da1944244511aad97d2df09d47c0c3c
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r--org.eclipse.jgit.junit/META-INF/MANIFEST.MF40
-rw-r--r--org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF4
-rw-r--r--org.eclipse.jgit.junit/pom.xml2
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java28
4 files changed, 40 insertions, 34 deletions
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
index 308feb7353..637fad0180 100644
--- a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
@@ -3,34 +3,34 @@ Bundle-ManifestVersion: 2
Bundle-Name: %plugin_name
Automatic-Module-Name: org.eclipse.jgit.junit
Bundle-SymbolicName: org.eclipse.jgit.junit
-Bundle-Version: 5.4.0.qualifier
+Bundle-Version: 5.4.1.qualifier
Bundle-Localization: plugin
Bundle-Vendor: %provider_name
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: org.eclipse.jgit.annotations;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.api;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.api.errors;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.dircache;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.errors;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.internal.storage.file;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.internal.storage.pack;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.lib;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.merge;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.revwalk;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.storage.file;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.transport;version="5.4.0",
- org.eclipse.jgit.treewalk;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.treewalk.filter;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.util;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.util.io;version="[5.4.0,5.5.0)",
- org.eclipse.jgit.util.time;version="[5.4.0,5.5.0)",
+Import-Package: org.eclipse.jgit.annotations;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.api;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.api.errors;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.dircache;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.errors;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.internal.storage.file;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.internal.storage.pack;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.lib;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.merge;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.revwalk;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.storage.file;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.transport;version="5.4.1",
+ org.eclipse.jgit.treewalk;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.treewalk.filter;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.util;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.util.io;version="[5.4.1,5.5.0)",
+ org.eclipse.jgit.util.time;version="[5.4.1,5.5.0)",
org.junit;version="[4.12,5.0.0)",
org.junit.rules;version="[4.12,5.0.0)",
org.junit.runner;version="[4.12,5.0.0)",
org.junit.runners.model;version="[4.12,5.0.0)",
org.slf4j;version="[1.7.0,2.0.0)"
-Export-Package: org.eclipse.jgit.junit;version="5.4.0";
+Export-Package: org.eclipse.jgit.junit;version="5.4.1";
uses:="org.eclipse.jgit.dircache,
org.eclipse.jgit.lib,
org.eclipse.jgit.revwalk,
@@ -43,4 +43,4 @@ Export-Package: org.eclipse.jgit.junit;version="5.4.0";
org.junit.runners.model,
org.junit.runner,
org.eclipse.jgit.util.time",
- org.eclipse.jgit.junit.time;version="5.4.0";uses:="org.eclipse.jgit.util.time"
+ org.eclipse.jgit.junit.time;version="5.4.1";uses:="org.eclipse.jgit.util.time"
diff --git a/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF
index ad3ad5bbcc..f244ece298 100644
--- a/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF
+++ b/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF
@@ -3,5 +3,5 @@ Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.jgit.junit - Sources
Bundle-SymbolicName: org.eclipse.jgit.junit.source
Bundle-Vendor: Eclipse.org - JGit
-Bundle-Version: 5.4.0.qualifier
-Eclipse-SourceBundle: org.eclipse.jgit.junit;version="5.4.0.qualifier";roots="."
+Bundle-Version: 5.4.1.qualifier
+Eclipse-SourceBundle: org.eclipse.jgit.junit;version="5.4.1.qualifier";roots="."
diff --git a/org.eclipse.jgit.junit/pom.xml b/org.eclipse.jgit.junit/pom.xml
index b6f5b35fbf..392fd5142d 100644
--- a/org.eclipse.jgit.junit/pom.xml
+++ b/org.eclipse.jgit.junit/pom.xml
@@ -52,7 +52,7 @@
<parent>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit-parent</artifactId>
- <version>5.4.0-SNAPSHOT</version>
+ <version>5.4.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.junit</artifactId>
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
index 48d016c064..a5270ed2b9 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java
@@ -349,7 +349,8 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* younger modification timestamp than the modification timestamp of the
* given file. This is done by touching a temporary file, reading the
* lastmodified attribute and, if needed, sleeping. After sleeping this loop
- * starts again until the filesystem timer has advanced enough.
+ * starts again until the filesystem timer has advanced enough. The
+ * temporary file will be created as a sibling of lastFile.
*
* @param lastFile
* the file on which we want to wait until the filesystem timer
@@ -362,21 +363,26 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
*/
public static long fsTick(File lastFile) throws InterruptedException,
IOException {
- long sleepTime = 64;
+ File tmp;
FS fs = FS.DETECTED;
- if (lastFile != null && !fs.exists(lastFile))
- throw new FileNotFoundException(lastFile.getPath());
- File tmp = File.createTempFile("FileTreeIteratorWithTimeControl", null);
+ if (lastFile == null) {
+ lastFile = tmp = File
+ .createTempFile("fsTickTmpFile", null);
+ } else {
+ if (!fs.exists(lastFile)) {
+ throw new FileNotFoundException(lastFile.getPath());
+ }
+ tmp = File.createTempFile("fsTickTmpFile", null,
+ lastFile.getParentFile());
+ }
+ long res = FS.getFsTimerResolution(tmp.toPath()).toMillis();
+ long sleepTime = res / 10;
try {
- long startTime = (lastFile == null) ? fs.lastModified(tmp) : fs
- .lastModified(lastFile);
+ long startTime = fs.lastModified(lastFile);
long actTime = fs.lastModified(tmp);
while (actTime <= startTime) {
Thread.sleep(sleepTime);
- sleepTime *= 2;
- try (FileOutputStream fos = new FileOutputStream(tmp)) {
- // Do nothing
- }
+ FileUtils.touch(tmp.toPath());
actTime = fs.lastModified(tmp);
}
return actTime;