Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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.MF7
-rw-r--r--org.eclipse.jgit.junit/pom.xml45
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java20
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java30
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/RepositoryTestCase.java4
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java4
7 files changed, 98 insertions, 52 deletions
diff --git a/org.eclipse.jgit.junit/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit/META-INF/MANIFEST.MF
index a104bc1218..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.3.3.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.3.3,5.4.0)",
- org.eclipse.jgit.api;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.api.errors;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.dircache;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.errors;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.internal.storage.file;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.internal.storage.pack;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.lib;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.merge;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.revwalk;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.storage.file;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.transport;version="5.3.3",
- org.eclipse.jgit.treewalk;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.treewalk.filter;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.util;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.util.io;version="[5.3.3,5.4.0)",
- org.eclipse.jgit.util.time;version="[5.3.3,5.4.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.3.3";
+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.3.3";
org.junit.runners.model,
org.junit.runner,
org.eclipse.jgit.util.time",
- org.eclipse.jgit.junit.time;version="5.3.3";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
new file mode 100644
index 0000000000..f244ece298
--- /dev/null
+++ b/org.eclipse.jgit.junit/META-INF/SOURCE-MANIFEST.MF
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+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.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 e67a9cdc3d..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.3.3-SNAPSHOT</version>
+ <version>5.4.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.jgit.junit</artifactId>
@@ -64,6 +64,7 @@
<properties>
<translate-qualifier/>
+ <source-bundle-manifest>${project.build.directory}/META-INF/SOURCE-MANIFEST.MF</source-bundle-manifest>
</properties>
<dependencies>
@@ -94,6 +95,48 @@
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>translate-source-qualifier</id>
+ <phase>generate-resources</phase>
+ <configuration>
+ <target>
+ <copy file="META-INF/SOURCE-MANIFEST.MF" tofile="${source-bundle-manifest}" overwrite="true"/>
+ <replace file="${source-bundle-manifest}">
+ <replacefilter token=".qualifier" value=".${maven.build.timestamp}"/>
+ </replace>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <inherited>true</inherited>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <archive>
+ <manifestFile>${source-bundle-manifest}</manifestFile>
+ </archive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index 3b7cdde496..5c2cd6ac65 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -373,7 +373,9 @@ public abstract class LocalDiskRepositoryTestCase {
/**
* Creates a new empty bare repository.
*
- * @return the newly created repository, opened for access
+ * @return the newly created bare repository, opened for access. The
+ * repository will not be closed in {@link #tearDown()}; the caller
+ * is responsible for closing it.
* @throws IOException
* the repository could not be created in the temporary area
*/
@@ -384,7 +386,9 @@ public abstract class LocalDiskRepositoryTestCase {
/**
* Creates a new empty repository within a new empty working directory.
*
- * @return the newly created repository, opened for access
+ * @return the newly created repository, opened for access. The repository
+ * will not be closed in {@link #tearDown()}; the caller is
+ * responsible for closing it.
* @throws IOException
* the repository could not be created in the temporary area
*/
@@ -398,7 +402,9 @@ public abstract class LocalDiskRepositoryTestCase {
* @param bare
* true to create a bare repository; false to make a repository
* within its working directory
- * @return the newly created repository, opened for access
+ * @return the newly created repository, opened for access. The repository
+ * will not be closed in {@link #tearDown()}; the caller is
+ * responsible for closing it.
* @throws IOException
* the repository could not be created in the temporary area
* @since 5.3
@@ -555,13 +561,7 @@ public abstract class LocalDiskRepositoryTestCase {
try {
write(f, body);
return f;
- } catch (Error e) {
- f.delete();
- throw e;
- } catch (RuntimeException e) {
- f.delete();
- throw e;
- } catch (IOException e) {
+ } catch (Error | RuntimeException | IOException e) {
f.delete();
throw e;
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
index 123fdb305f..13c2932282 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/MockSystemReader.java
@@ -220,22 +220,20 @@ public class MockSystemReader extends SystemReader {
/** {@inheritDoc} */
@Override
public MonotonicClock getClock() {
- return new MonotonicClock() {
- @Override
- public ProposedTimestamp propose() {
- long t = getCurrentTime();
- return new ProposedTimestamp() {
- @Override
- public long read(TimeUnit unit) {
- return unit.convert(t, TimeUnit.MILLISECONDS);
- }
-
- @Override
- public void blockUntil(Duration maxWait) {
- // Do not wait.
- }
- };
- }
+ return () -> {
+ long t = getCurrentTime();
+ return new ProposedTimestamp() {
+
+ @Override
+ public long read(TimeUnit unit) {
+ return unit.convert(t, TimeUnit.MILLISECONDS);
+ }
+
+ @Override
+ public void blockUntil(Duration maxWait) {
+ // Do not wait.
+ }
+ };
};
}
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 5aacbbadec..23f49a4752 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
@@ -496,9 +496,7 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
git.branchCreate().setName(branch).setStartPoint(commit).call();
return commit;
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (GitAPIException e) {
+ } catch (IOException | GitAPIException e) {
throw new RuntimeException(e);
}
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index 02ffe4f409..e89cf0fb83 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -728,7 +728,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
ThreeWayMerger merger = MergeStrategy.RECURSIVE.newMerger(db, true);
merger.setBase(parent.getTree());
if (merger.merge(head, commit)) {
- if (AnyObjectId.equals(head.getTree(), merger.getResultTreeId()))
+ if (AnyObjectId.isEqual(head.getTree(), merger.getResultTreeId()))
return null;
tick(1);
org.eclipse.jgit.lib.CommitBuilder b =
@@ -1368,7 +1368,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
firstParentId = parents.get(0);
ObjectId cid;
- if (changeId.equals(""))
+ if (changeId.isEmpty())
cid = ChangeIdUtil.computeChangeId(c.getTreeId(), firstParentId,
c.getAuthor(), c.getCommitter(), message);
else

Back to the top