diff options
Diffstat (limited to 'org.eclipse.jgit.http.test/src')
-rw-r--r-- | org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java b/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java index 78f909eeac..6f85979785 100644 --- a/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java +++ b/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java @@ -43,10 +43,14 @@ package org.eclipse.jgit.http.test; import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository; -import org.eclipse.jgit.internal.storage.reftable.Reftable; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefDatabase; /** @@ -82,12 +86,43 @@ class RefsUnreadableInMemoryRepository extends InMemoryRepository { } private class RefsUnreadableRefDatabase extends MemRefDatabase { + + /** {@inheritDoc} */ + @Override + public Ref exactRef(String name) throws IOException { + if (failing) { + throw new IOException("disk failed, no refs found"); + } + return super.exactRef(name); + } + + /** {@inheritDoc} */ + @Override + public Map<String, Ref> getRefs(String prefix) throws IOException { + if (failing) { + throw new IOException("disk failed, no refs found"); + } + + return super.getRefs(prefix); + } + + /** {@inheritDoc} */ + @Override + public List<Ref> getRefsByPrefix(String prefix) throws IOException { + if (failing) { + throw new IOException("disk failed, no refs found"); + } + + return super.getRefsByPrefix(prefix); + } + + /** {@inheritDoc} */ @Override - protected Reftable reader() throws IOException { + public Set<Ref> getTipsWithSha1(ObjectId id) throws IOException { if (failing) { throw new IOException("disk failed, no refs found"); } - return super.reader(); + return super.getTipsWithSha1(id); } } } |