diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-04-16 00:05:41 +0200 |
---|---|---|
committer | Chris Aniszczyk <zx@twitter.com> | 2013-04-18 15:33:50 -0500 |
commit | 526b6266a5afa1de67a1667230fc4ebea331dab5 (patch) | |
tree | 6fc9562072694ee57a62b33336486f575fac1ad0 /org.eclipse.jgit.http.test/tst | |
parent | 6e90671a51eb91f4c53263e4169e736da6476ba2 (diff) | |
download | jgit-526b6266a5afa1de67a1667230fc4ebea331dab5.tar.gz jgit-526b6266a5afa1de67a1667230fc4ebea331dab5.zip |
Remove some unnecessary dependencies on FileRepostory
Change-Id: Ib6ee3a2874a7e2240aa68f4ac32d00c4d1fab5ae
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
Diffstat (limited to 'org.eclipse.jgit.http.test/tst')
7 files changed, 28 insertions, 35 deletions
diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java index 7d6df7bb6a..0285bd1679 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/AdvertiseErrorTest.java @@ -56,16 +56,15 @@ import org.eclipse.jgit.errors.RemoteRepositoryException; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.http.server.GitServlet; import org.eclipse.jgit.http.server.resolver.DefaultReceivePackFactory; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.HttpTestCase; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.revwalk.RevCommit; -import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.transport.ReceivePack; import org.eclipse.jgit.transport.RemoteRefUpdate; import org.eclipse.jgit.transport.Transport; @@ -77,7 +76,7 @@ import org.junit.Before; import org.junit.Test; public class AdvertiseErrorTest extends HttpTestCase { - private FileRepository remoteRepository; + private Repository remoteRepository; private URIish remoteURI; @@ -85,7 +84,7 @@ public class AdvertiseErrorTest extends HttpTestCase { public void setUp() throws Exception { super.setUp(); - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final String srcName = src.getRepository().getDirectory().getName(); ServletContextHandler app = server.addContext("/git"); @@ -121,7 +120,7 @@ public class AdvertiseErrorTest extends HttpTestCase { remoteRepository = src.getRepository(); remoteURI = toURIish(app, srcName); - FileBasedConfig cfg = remoteRepository.getConfig(); + StoredConfig cfg = remoteRepository.getConfig(); cfg.setBoolean("http", null, "receivepack", true); cfg.save(); } diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java index 32e0c36a12..fbf4d075ad 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientDumbServerTest.java @@ -61,7 +61,6 @@ import java.util.Map; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jgit.errors.NotSupportedException; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.AccessEvent; import org.eclipse.jgit.junit.http.HttpTestCase; @@ -92,7 +91,7 @@ public class DumbClientDumbServerTest extends HttpTestCase { public void setUp() throws Exception { super.setUp(); - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final File srcGit = src.getRepository().getDirectory(); final URI base = srcGit.getParentFile().toURI(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java index fb77e6d55a..354b0439ab 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/DumbClientSmartServerTest.java @@ -65,7 +65,6 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jgit.errors.NotSupportedException; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.http.server.GitServlet; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.AccessEvent; import org.eclipse.jgit.junit.http.HttpTestCase; @@ -98,7 +97,7 @@ public class DumbClientSmartServerTest extends HttpTestCase { public void setUp() throws Exception { super.setUp(); - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final String srcName = src.getRepository().getDirectory().getName(); ServletContextHandler app = server.addContext("/git"); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java index 155a43399c..f1056f2d6a 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HookMessageTest.java @@ -60,7 +60,6 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.http.server.GitServlet; import org.eclipse.jgit.http.server.resolver.DefaultReceivePackFactory; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.AccessEvent; import org.eclipse.jgit.junit.http.HttpTestCase; @@ -68,9 +67,9 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.revwalk.RevCommit; -import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.transport.PreReceiveHook; import org.eclipse.jgit.transport.PushResult; import org.eclipse.jgit.transport.ReceiveCommand; @@ -85,7 +84,7 @@ import org.junit.Before; import org.junit.Test; public class HookMessageTest extends HttpTestCase { - private FileRepository remoteRepository; + private Repository remoteRepository; private URIish remoteURI; @@ -93,7 +92,7 @@ public class HookMessageTest extends HttpTestCase { public void setUp() throws Exception { super.setUp(); - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final String srcName = src.getRepository().getDirectory().getName(); ServletContextHandler app = server.addContext("/git"); @@ -134,7 +133,7 @@ public class HookMessageTest extends HttpTestCase { remoteRepository = src.getRepository(); remoteURI = toURIish(app, srcName); - FileBasedConfig cfg = remoteRepository.getConfig(); + StoredConfig cfg = remoteRepository.getConfig(); cfg.setBoolean("http", null, "receivepack", true); cfg.save(); } diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java index b803ef7358..8bdaf2cb6a 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/HttpClientTests.java @@ -64,7 +64,6 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.errors.TransportException; import org.eclipse.jgit.http.server.GitServlet; import org.eclipse.jgit.internal.JGitText; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.AccessEvent; import org.eclipse.jgit.junit.http.AppServer; @@ -73,8 +72,8 @@ import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.revwalk.RevCommit; -import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.transport.FetchConnection; import org.eclipse.jgit.transport.Transport; import org.eclipse.jgit.transport.URIish; @@ -85,7 +84,7 @@ import org.junit.Before; import org.junit.Test; public class HttpClientTests extends HttpTestCase { - private TestRepository<FileRepository> remoteRepository; + private TestRepository<Repository> remoteRepository; private URIish dumbAuthNoneURI; @@ -134,7 +133,7 @@ public class HttpClientTests extends HttpTestCase { public Repository open(HttpServletRequest req, String name) throws RepositoryNotFoundException, ServiceNotEnabledException { - final FileRepository db = remoteRepository.getRepository(); + final Repository db = remoteRepository.getRepository(); if (!name.equals(nameOf(db))) throw new RepositoryNotFoundException(name); @@ -148,7 +147,7 @@ public class HttpClientTests extends HttpTestCase { return ctx; } - private static String nameOf(final FileRepository db) { + private static String nameOf(final Repository db) { return db.getDirectory().getName(); } @@ -217,7 +216,7 @@ public class HttpClientTests extends HttpTestCase { @Test public void testListRemote_Dumb_NoHEAD() throws Exception { - FileRepository src = remoteRepository.getRepository(); + Repository src = remoteRepository.getRepository(); File headref = new File(src.getDirectory(), Constants.HEAD); assertTrue("HEAD used to be present", headref.delete()); assertFalse("HEAD is gone", headref.exists()); @@ -356,8 +355,8 @@ public class HttpClientTests extends HttpTestCase { @Test public void testListRemote_Smart_UploadPackDisabled() throws Exception { - FileRepository src = remoteRepository.getRepository(); - final FileBasedConfig cfg = src.getConfig(); + Repository src = remoteRepository.getRepository(); + final StoredConfig cfg = src.getConfig(); cfg.setBoolean("http", null, "uploadpack", false); cfg.save(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java index 0b57a210b2..2823b34b1f 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/ProtocolErrorTest.java @@ -61,14 +61,13 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.http.server.GitServlet; import org.eclipse.jgit.http.server.GitSmartHttpTools; import org.eclipse.jgit.internal.JGitText; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.junit.http.HttpTestCase; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.revwalk.RevBlob; -import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.transport.PacketLineIn; import org.eclipse.jgit.transport.PacketLineOut; import org.eclipse.jgit.transport.URIish; @@ -79,7 +78,7 @@ import org.junit.Before; import org.junit.Test; public class ProtocolErrorTest extends HttpTestCase { - private FileRepository remoteRepository; + private Repository remoteRepository; private URIish remoteURI; @@ -89,7 +88,7 @@ public class ProtocolErrorTest extends HttpTestCase { public void setUp() throws Exception { super.setUp(); - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final String srcName = src.getRepository().getDirectory().getName(); ServletContextHandler app = server.addContext("/git"); @@ -113,7 +112,7 @@ public class ProtocolErrorTest extends HttpTestCase { remoteRepository = src.getRepository(); remoteURI = toURIish(app, srcName); - FileBasedConfig cfg = remoteRepository.getConfig(); + StoredConfig cfg = remoteRepository.getConfig(); cfg.setBoolean("http", null, "receivepack", true); cfg.save(); diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index 6813d5aa1a..9f5b2f85a6 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -78,7 +78,6 @@ import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.errors.TransportException; import org.eclipse.jgit.http.server.GitServlet; import org.eclipse.jgit.internal.JGitText; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.internal.storage.file.ReflogEntry; import org.eclipse.jgit.internal.storage.file.ReflogReader; import org.eclipse.jgit.junit.TestRepository; @@ -90,9 +89,9 @@ import org.eclipse.jgit.lib.NullProgressMonitor; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.revwalk.RevCommit; -import org.eclipse.jgit.storage.file.FileBasedConfig; import org.eclipse.jgit.transport.FetchConnection; import org.eclipse.jgit.transport.HttpTransport; import org.eclipse.jgit.transport.RemoteRefUpdate; @@ -107,7 +106,7 @@ import org.junit.Test; public class SmartClientSmartServerTest extends HttpTestCase { private static final String HDR_TRANSFER_ENCODING = "Transfer-Encoding"; - private FileRepository remoteRepository; + private Repository remoteRepository; private URIish remoteURI; @@ -121,7 +120,7 @@ public class SmartClientSmartServerTest extends HttpTestCase { public void setUp() throws Exception { super.setUp(); - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final String srcName = src.getRepository().getDirectory().getName(); ServletContextHandler app = server.addContext("/git"); @@ -601,16 +600,16 @@ public class SmartClientSmartServerTest extends HttpTestCase { @Test public void testPush_ChunkedEncoding() throws Exception { - final TestRepository<FileRepository> src = createTestRepository(); + final TestRepository<Repository> src = createTestRepository(); final RevBlob Q_bin = src.blob(new TestRng("Q").nextBytes(128 * 1024)); final RevCommit Q = src.commit().add("Q", Q_bin).create(); - final FileRepository db = src.getRepository(); + final Repository db = src.getRepository(); final String dstName = Constants.R_HEADS + "new.branch"; Transport t; enableReceivePack(); - final FileBasedConfig cfg = db.getConfig(); + final StoredConfig cfg = db.getConfig(); cfg.setInt("core", null, "compression", 0); cfg.setInt("http", null, "postbuffer", 8 * 1024); cfg.save(); @@ -660,7 +659,7 @@ public class SmartClientSmartServerTest extends HttpTestCase { } private void enableReceivePack() throws IOException { - final FileBasedConfig cfg = remoteRepository.getConfig(); + final StoredConfig cfg = remoteRepository.getConfig(); cfg.setBoolean("http", null, "receivepack", true); cfg.save(); } |