diff options
author | Shawn Pearce <sop@google.com> | 2013-11-01 11:32:04 -0600 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2013-11-24 05:27:21 -0500 |
commit | 531d5776584926f2532847be63c2213c0793a68e (patch) | |
tree | aba48bb2feb82233db7a39ea3cf6deea5dcac3a4 | |
parent | d54d19740a5a3185b011f954682ef5aaad020846 (diff) | |
download | jgit-531d5776584926f2532847be63c2213c0793a68e.tar.gz jgit-531d5776584926f2532847be63c2213c0793a68e.zip |
Modify T0004_PackReaderTest to use existing pack
Instead of making a new PackFile from a resource, lookup
the existing PackFile that was already created by the base
class SampleDataRepositoryTestCase.
Change-Id: Ib5da18c832ae0cb29703706b99e99503f5cc819d
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0004_PackReaderTest.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0004_PackReaderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0004_PackReaderTest.java index 2ca0b5cbdc..e8e3d1db68 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0004_PackReaderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/T0004_PackReaderTest.java @@ -46,17 +46,11 @@ package org.eclipse.jgit.internal.storage.file; -import static org.eclipse.jgit.internal.storage.pack.PackExt.INDEX; -import static org.eclipse.jgit.internal.storage.pack.PackExt.PACK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import java.io.File; import java.io.IOException; -import org.eclipse.jgit.internal.storage.file.PackFile; -import org.eclipse.jgit.internal.storage.file.WindowCursor; -import org.eclipse.jgit.junit.JGitTestUtil; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectLoader; @@ -64,17 +58,23 @@ import org.eclipse.jgit.test.resources.SampleDataRepositoryTestCase; import org.junit.Test; public class T0004_PackReaderTest extends SampleDataRepositoryTestCase { - private static final String PACK_NAME = "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f"; - private static final File TEST_PACK = JGitTestUtil.getTestResourceFile(PACK_NAME + ".pack"); + private static final String PACK_NAME = "34be9032ac282b11fa9babdc2b2a93ca996c9c2f"; @Test public void test003_lookupCompressedObject() throws IOException { - final PackFile pr; final ObjectId id; final ObjectLoader or; + PackFile pr = null; + for (PackFile p : db.getObjectDatabase().getPacks()) { + if (PACK_NAME.equals(p.getPackName())) { + pr = p; + break; + } + } + assertNotNull("have pack-" + PACK_NAME, pr); + id = ObjectId.fromString("902d5476fa249b7abc9d84c611577a81381f0327"); - pr = new PackFile(TEST_PACK, PACK.getBit() | INDEX.getBit()); or = pr.get(new WindowCursor(null), id); assertNotNull(or); assertEquals(Constants.OBJ_TREE, or.getType()); |