<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
</dependencies>
<build>
+ <sourceDirectory>src/</sourceDirectory>
<testSourceDirectory>tst/</testSourceDirectory>
<testResources>
--- /dev/null
+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.
+ * <p>
+ * 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();
+ }
+ }
+ }
+}
+++ /dev/null
-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.
- * <p>
- * 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();
- }
- }
- }
-}
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<quiet>true</quiet>
+ <excludePackageNames>org.eclipse.jgit.http.test</excludePackageNames>
<links>
<link>http://docs.oracle.com/javase/7/docs/api</link>
</links>