From: Mike Edgar Date: Wed, 13 Apr 2016 02:23:08 +0000 (-0400) Subject: Fix Buck build broken by 4812fda. X-Git-Tag: v4.4.0.201605041135-m1~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3b526f863aa154e76ac9d93547ac7a90f6e579e0;p=jgit.git Fix Buck build broken by 4812fda. Creates a source directory under org.eclipse.jgit.http.test for the new support class. Signed-off-by: Michael Edgar Change-Id: Ie49492c2bbe5c1db96ceb0dc06fa7cb9f927431a --- diff --git a/org.eclipse.jgit.http.test/pom.xml b/org.eclipse.jgit.http.test/pom.xml index 31fda8b242..69ffe4954b 100644 --- a/org.eclipse.jgit.http.test/pom.xml +++ b/org.eclipse.jgit.http.test/pom.xml @@ -72,7 +72,6 @@ org.eclipse.jgit org.eclipse.jgit ${project.version} - test @@ -111,6 +110,7 @@ + src/ tst/ 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 new file mode 100644 index 0000000000..485cced778 --- /dev/null +++ b/org.eclipse.jgit.http.test/src/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java @@ -0,0 +1,52 @@ +package org.eclipse.jgit.http.test; + +import java.io.IOException; +import java.util.concurrent.atomic.AtomicBoolean; + +import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; +import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository; +import org.eclipse.jgit.lib.RefDatabase; + +/** + * An {@link InMemoryRepository} whose refs can be made unreadable for testing + * purposes. + */ +class RefsUnreadableInMemoryRepository extends InMemoryRepository { + + private final RefsUnreadableRefDatabase refs; + + private volatile boolean failing; + + RefsUnreadableInMemoryRepository(DfsRepositoryDescription repoDesc) { + super(repoDesc); + refs = new RefsUnreadableRefDatabase(); + failing = false; + } + + @Override + public RefDatabase getRefDatabase() { + return refs; + } + + /** + * Make the ref database unable to scan its refs. + *

+ * It may be useful to follow a call to startFailing with a call to + * {@link RefDatabase#refresh()}, ensuring the next ref read fails. + */ + void startFailing() { + failing = true; + } + + private class RefsUnreadableRefDatabase extends MemRefDatabase { + + @Override + protected RefCache scanAllRefs() throws IOException { + if (failing) { + throw new IOException("disk failed, no refs found"); + } else { + return super.scanAllRefs(); + } + } + } +} diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java deleted file mode 100644 index 485cced778..0000000000 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/RefsUnreadableInMemoryRepository.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.eclipse.jgit.http.test; - -import java.io.IOException; -import java.util.concurrent.atomic.AtomicBoolean; - -import org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription; -import org.eclipse.jgit.internal.storage.dfs.InMemoryRepository; -import org.eclipse.jgit.lib.RefDatabase; - -/** - * An {@link InMemoryRepository} whose refs can be made unreadable for testing - * purposes. - */ -class RefsUnreadableInMemoryRepository extends InMemoryRepository { - - private final RefsUnreadableRefDatabase refs; - - private volatile boolean failing; - - RefsUnreadableInMemoryRepository(DfsRepositoryDescription repoDesc) { - super(repoDesc); - refs = new RefsUnreadableRefDatabase(); - failing = false; - } - - @Override - public RefDatabase getRefDatabase() { - return refs; - } - - /** - * Make the ref database unable to scan its refs. - *

- * It may be useful to follow a call to startFailing with a call to - * {@link RefDatabase#refresh()}, ensuring the next ref read fails. - */ - void startFailing() { - failing = true; - } - - private class RefsUnreadableRefDatabase extends MemRefDatabase { - - @Override - protected RefCache scanAllRefs() throws IOException { - if (failing) { - throw new IOException("disk failed, no refs found"); - } else { - return super.scanAllRefs(); - } - } - } -} diff --git a/pom.xml b/pom.xml index a691b8ea90..e80d4fb1fe 100644 --- a/pom.xml +++ b/pom.xml @@ -453,6 +453,7 @@ ${project.build.sourceEncoding} true + org.eclipse.jgit.http.test http://docs.oracle.com/javase/7/docs/api