1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.eclipse.jgit.test.resources;
15
16 import java.io.File;
17 import java.io.IOException;
18
19 import org.eclipse.jgit.internal.storage.file.FileRepository;
20 import org.eclipse.jgit.junit.JGitTestUtil;
21 import org.eclipse.jgit.junit.RepositoryTestCase;
22
23
24
25 public abstract class SampleDataRepositoryTestCase extends RepositoryTestCase {
26 @Override
27 public void setUp() throws Exception {
28 super.setUp();
29 copyCGitTestPacks(db);
30 }
31
32
33
34
35
36
37
38
39 public static void copyCGitTestPacks(FileRepository repo) throws IOException {
40 final String[] packs = {
41 "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f",
42 "pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371",
43 "pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745",
44 "pack-546ff360fe3488adb20860ce3436a2d6373d2796",
45 "pack-cbdeda40019ae0e6e789088ea0f51f164f489d14",
46 "pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa",
47 "pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12"
48 };
49 final File packDir = repo.getObjectDatabase().getPackDirectory();
50 for (String n : packs) {
51 JGitTestUtil.copyTestResource(n + ".pack", new File(packDir, n + ".pack"));
52 JGitTestUtil.copyTestResource(n + ".idx", new File(packDir, n + ".idx"));
53 }
54
55 JGitTestUtil.copyTestResource("packed-refs",
56 new File(repo.getDirectory(), "packed-refs"));
57 }
58 }