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.test/tst/org/eclipse/jgit | |
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.test/tst/org/eclipse/jgit')
9 files changed, 27 insertions, 35 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java index ac7584949b..8d22a1b58a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandTest.java @@ -56,7 +56,6 @@ import java.io.IOException; import org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode; import org.eclipse.jgit.api.MergeResult.MergeStatus; import org.eclipse.jgit.api.errors.NoHeadException; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.RepositoryTestCase; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; @@ -74,7 +73,7 @@ import org.junit.Test; public class PullCommandTest extends RepositoryTestCase { /** Second Test repository */ - protected FileRepository dbTarget; + protected Repository dbTarget; private Git source; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java index 51ebf72bfd..993e16f5e9 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/PullCommandWithRebaseTest.java @@ -57,7 +57,6 @@ import java.io.IOException; import org.eclipse.jgit.api.CreateBranchCommand.SetupUpstreamMode; import org.eclipse.jgit.api.MergeResult.MergeStatus; import org.eclipse.jgit.api.RebaseResult.Status; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.RepositoryTestCase; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; @@ -76,7 +75,7 @@ import org.junit.Test; public class PullCommandWithRebaseTest extends RepositoryTestCase { /** Second Test repository */ - protected FileRepository dbTarget; + protected Repository dbTarget; private Git source; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java index dd43dbba82..3a0b827b3f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java @@ -68,6 +68,7 @@ import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.lib.AbbreviatedObjectId; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectReader; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.transport.PackedObjectInfo; import org.eclipse.jgit.util.FileUtils; @@ -81,14 +82,14 @@ public class AbbreviationTest extends LocalDiskRepositoryTestCase { private ObjectReader reader; - private TestRepository<FileRepository> test; + private TestRepository<Repository> test; @Before public void setUp() throws Exception { super.setUp(); db = createBareRepository(); reader = db.newObjectReader(); - test = new TestRepository<FileRepository>(db); + test = new TestRepository<Repository>(db); } @After diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java index 46c4af3973..0655415a9d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderTest.java @@ -56,7 +56,7 @@ import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Repository; -import org.eclipse.jgit.storage.file.FileBasedConfig; +import org.eclipse.jgit.lib.StoredConfig; import org.eclipse.jgit.storage.file.FileRepositoryBuilder; import org.eclipse.jgit.util.FileUtils; import org.junit.Test; @@ -64,7 +64,7 @@ import org.junit.Test; public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @Test public void testShouldAutomagicallyDetectGitDirectory() throws Exception { - FileRepository r = createWorkRepository(); + Repository r = createWorkRepository(); File d = new File(r.getDirectory(), "sub-dir"); FileUtils.mkdir(d); @@ -74,8 +74,8 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @Test public void emptyRepositoryFormatVersion() throws Exception { - FileRepository r = createWorkRepository(); - FileBasedConfig config = r.getConfig(); + Repository r = createWorkRepository(); + StoredConfig config = r.getConfig(); config.setString(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_REPO_FORMAT_VERSION, ""); config.save(); @@ -85,8 +85,8 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @Test public void invalidRepositoryFormatVersion() throws Exception { - FileRepository r = createWorkRepository(); - FileBasedConfig config = r.getConfig(); + Repository r = createWorkRepository(); + StoredConfig config = r.getConfig(); config.setString(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_REPO_FORMAT_VERSION, "notanumber"); config.save(); @@ -101,8 +101,8 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @Test public void unknownRepositoryFormatVersion() throws Exception { - FileRepository r = createWorkRepository(); - FileBasedConfig config = r.getConfig(); + Repository r = createWorkRepository(); + StoredConfig config = r.getConfig(); config.setLong(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_REPO_FORMAT_VERSION, 1); config.save(); @@ -118,7 +118,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @SuppressWarnings("resource" /* java 7 */) @Test public void absoluteGitDirRef() throws Exception { - FileRepository repo1 = createWorkRepository(); + Repository repo1 = createWorkRepository(); File dir = createTempDirectory("dir"); File dotGit = new File(dir, Constants.DOT_GIT); new FileWriter(dotGit).append( @@ -136,7 +136,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @SuppressWarnings("resource" /* java 7 */) @Test public void relativeGitDirRef() throws Exception { - FileRepository repo1 = createWorkRepository(); + Repository repo1 = createWorkRepository(); File dir = new File(repo1.getWorkTree(), "dir"); assertTrue(dir.mkdir()); File dotGit = new File(dir, Constants.DOT_GIT); @@ -155,7 +155,7 @@ public class FileRepositoryBuilderTest extends LocalDiskRepositoryTestCase { @SuppressWarnings("resource" /* java 7 */) @Test public void scanWithGitDirRef() throws Exception { - FileRepository repo1 = createWorkRepository(); + Repository repo1 = createWorkRepository(); File dir = createTempDirectory("dir"); File dotGit = new File(dir, Constants.DOT_GIT); new FileWriter(dotGit).append( diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GCTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GCTest.java index d5c8f12ef6..9d2a03b097 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GCTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GCTest.java @@ -64,13 +64,6 @@ import java.util.concurrent.TimeUnit; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.internal.JGitText; -import org.eclipse.jgit.internal.storage.file.FileRepository; -import org.eclipse.jgit.internal.storage.file.GC; -import org.eclipse.jgit.internal.storage.file.LockFile; -import org.eclipse.jgit.internal.storage.file.PackFile; -import org.eclipse.jgit.internal.storage.file.PackIndex; -import org.eclipse.jgit.internal.storage.file.RefDirectory; -import org.eclipse.jgit.internal.storage.file.RefDirectoryUpdate; import org.eclipse.jgit.internal.storage.file.GC.RepoStatistics; import org.eclipse.jgit.internal.storage.file.PackIndex.MutableEntry; import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java index 64941995de..ced4575f20 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackFileTest.java @@ -71,6 +71,7 @@ import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectInserter; import org.eclipse.jgit.lib.ObjectLoader; import org.eclipse.jgit.lib.ObjectStream; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.revwalk.RevBlob; import org.eclipse.jgit.storage.file.WindowCacheConfig; import org.eclipse.jgit.transport.PackParser; @@ -86,9 +87,9 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { private TestRng rng; - private FileRepository repo; + private Repository repo; - private TestRepository<FileRepository> tr; + private TestRepository<Repository> tr; private WindowCursor wc; @@ -107,7 +108,7 @@ public class PackFileTest extends LocalDiskRepositoryTestCase { WindowCache.reconfigure(cfg); repo = createBareRepository(); - tr = new TestRepository<FileRepository>(repo); + tr = new TestRepository<Repository>(repo); wc = (WindowCursor) repo.newObjectReader(); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java index 7712097203..f44f67f845 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java @@ -61,7 +61,6 @@ import org.eclipse.jgit.dircache.DirCacheEditor; import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.errors.ConfigInvalidException; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.RepositoryTestCase; import org.eclipse.jgit.junit.TestRepository; import org.eclipse.jgit.lib.Config; @@ -81,12 +80,12 @@ import org.junit.Test; * Unit tests of {@link SubmoduleWalk} */ public class SubmoduleWalkTest extends RepositoryTestCase { - private TestRepository<FileRepository> testDb; + private TestRepository<Repository> testDb; @Before public void setUp() throws Exception { super.setUp(); - testDb = new TestRepository<FileRepository>(db); + testDb = new TestRepository<Repository>(db); } @Test diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java index c6b3ba624e..aba4e6a8f8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java @@ -55,10 +55,10 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.SampleDataRepositoryTestCase; import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.Repository; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -216,7 +216,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { @Test public void testLocalTransportWithRelativePath() throws Exception { - FileRepository other = createWorkRepository(); + Repository other = createWorkRepository(); String otherDir = other.getWorkTree().getName(); RemoteConfig config = new RemoteConfig(db.getConfig(), "other"); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java index f74c44cfe7..b3aa0ee686 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/InterIndexDiffFilterTest.java @@ -50,21 +50,21 @@ import java.io.IOException; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheEditor; +import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.dircache.DirCacheIterator; -import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; -import org.eclipse.jgit.internal.storage.file.FileRepository; import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.FileMode; import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.treewalk.TreeWalk; import org.junit.Before; import org.junit.Test; public class InterIndexDiffFilterTest extends LocalDiskRepositoryTestCase { - private FileRepository db; + private Repository db; @Before public void setUp() throws Exception { |