{"thread":{"id":"15416","subject":"[JGIT PATCH 1/3] Introduce utility method to load test resources","startedAt":"2008-09-08T03:07:34Z","lastAt":"2008-09-09T02:05:57Z","messageCount":5,"participants":["imyousuf@gmail.com","Shawn O. Pearce","Imran M Yousuf"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"90040","messageId":"1220843256-1243-1-git-send-email-imyousuf@gmail.com","threadId":"15416","inReplyTo":null,"subject":"[JGIT PATCH 1/3] Introduce utility method to load test resources","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-09-08T03:07:34Z","receivedAt":"2008-09-08T03:07:34Z","isPatch":true,"sender":{"key":"imyousuf@gmail.com","avatar":"https://gravatar.com/avatar/fda3c870262849d03c7b9c4d288842e128d6d80769fa7bc2d22731b7597928be?d=mp&s=160"},"body":"From: Imran M Yousuf <imyousuf@smartitengineering.com>\n\nPreviously test resources were being loaded from the sources but code for\nloading them was done in different locations, thus introduced a utility\nclass that will contain utility operations and the first one's responsibility\nwould be to load test resources.\n\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n .../dircache/DirCacheCGitCompatabilityTest.java    |    3 +-\n .../tst/org/spearce/jgit/lib/PackIndexV1Test.java  |    9 ++++---\n .../tst/org/spearce/jgit/lib/PackIndexV2Test.java  |    5 ++-\n .../org/spearce/jgit/lib/PackReverseIndexTest.java |    5 +--\n .../tst/org/spearce/jgit/lib/PackWriterTest.java   |    3 +-\n .../org/spearce/jgit/lib/RepositoryTestCase.java   |    8 +++---\n .../tst/org/spearce/jgit/lib/T0004_PackReader.java |    8 ++++--\n .../org/spearce/jgit/transport/IndexPackTest.java  |    6 ++--\n .../tst/org/spearce/jgit/util/JGitTestUtil.java    |   25 +++++++++----------\n 9 files changed, 38 insertions(+), 34 deletions(-)\n copy org.spearce.jgit/src/org/spearce/jgit/util/FS_POSIX_Java5.java => org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java (80%)\n\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java\nindex 43b23f6..b052686 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/dircache/DirCacheCGitCompatabilityTest.java\n@@ -50,6 +50,7 @@\n import org.spearce.jgit.lib.ObjectId;\n import org.spearce.jgit.lib.RepositoryTestCase;\n import org.spearce.jgit.treewalk.TreeWalk;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n public class DirCacheCGitCompatabilityTest extends RepositoryTestCase {\n \tprivate final File index = pathOf(\"gitgit.index\");\n@@ -138,7 +139,7 @@ assertEquals(ObjectId\n \t}\n \n \tprivate File pathOf(final String name) {\n-\t\treturn new File(\"tst\", name);\n+\t\treturn JGitTestUtil.getTestResourceFile(name);\n \t}\n \n \tprivate Map<String, CGitIndexRecord> readLsFiles() throws Exception {\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV1Test.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV1Test.java\nindex 49235ca..645e054 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV1Test.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV1Test.java\n@@ -40,18 +40,19 @@\n import java.io.File;\n \n import org.spearce.jgit.errors.MissingObjectException;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n public class PackIndexV1Test extends PackIndexTest {\n \t@Override\n \tpublic File getFileForPack34be9032() {\n-\t\treturn new File(new File(\"tst\"),\n-\t\t\t\t\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\");\n+\t\treturn JGitTestUtil.getTestResourceFile(\n+                    \"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\");\n \t}\n \n \t@Override\n \tpublic File getFileForPackdf2982f28() {\n-\t\treturn new File(new File(\"tst\"),\n-\t\t\t\t\"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\");\n+\t\treturn JGitTestUtil.getTestResourceFile(\n+                    \"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\");\n \t}\n \n \t/**\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV2Test.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV2Test.java\nindex c986c49..d95937c 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV2Test.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackIndexV2Test.java\n@@ -40,17 +40,18 @@\n import java.io.File;\n \n import org.spearce.jgit.errors.MissingObjectException;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n public class PackIndexV2Test extends PackIndexTest {\n \t@Override\n \tpublic File getFileForPack34be9032() {\n-\t\treturn new File(new File(\"tst\"),\n+\t\treturn JGitTestUtil.getTestResourceFile(\n \t\t\t\t\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\");\n \t}\n \n \t@Override\n \tpublic File getFileForPackdf2982f28() {\n-\t\treturn new File(new File(\"tst\"),\n+\t\treturn JGitTestUtil.getTestResourceFile(\n \t\t\t\t\"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2\");\n \t}\n \ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackReverseIndexTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackReverseIndexTest.java\nindex 52d1282..c66818f 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackReverseIndexTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackReverseIndexTest.java\n@@ -37,10 +37,9 @@\n \n package org.spearce.jgit.lib;\n \n-import java.io.File;\n-\n import org.spearce.jgit.errors.CorruptObjectException;\n import org.spearce.jgit.lib.PackIndex.MutableEntry;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n public class PackReverseIndexTest extends RepositoryTestCase {\n \n@@ -54,7 +53,7 @@\n \tpublic void setUp() throws Exception {\n \t\tsuper.setUp();\n \t\t// index with both small (< 2^31) and big offsets\n-\t\tidx = PackIndex.open(new File(new File(\"tst\"),\n+\t\tidx = PackIndex.open(JGitTestUtil.getTestResourceFile(\n \t\t\t\t\"pack-huge.idx\"));\n \t\treverseIdx = new PackReverseIndex(idx);\n \t}\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackWriterTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackWriterTest.java\nindex 0fcb2dc..e5bce4d 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackWriterTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackWriterTest.java\n@@ -57,6 +57,7 @@\n import org.spearce.jgit.revwalk.RevWalk;\n import org.spearce.jgit.transport.IndexPack;\n import org.spearce.jgit.util.CountingOutputStream;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n public class PackWriterTest extends RepositoryTestCase {\n \n@@ -239,7 +240,7 @@ public void testWritePack2DeltasCRC32Copy() throws IOException {\n \t\t\t\t\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\");\n \t\tfinal File crc32Idx = new File(packDir,\n \t\t\t\t\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\");\n-\t\tcopyFile(new File(new File(\"tst\"),\n+\t\tcopyFile(JGitTestUtil.getTestResourceFile(\n \t\t\t\t\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\"),\n \t\t\t\tcrc32Idx);\n \t\tdb.openPack(crc32Pack, crc32Idx);\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java\nindex 14e7179..270b90a 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java\n@@ -47,6 +47,7 @@\n import java.io.Reader;\n \n import junit.framework.TestCase;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n public abstract class RepositoryTestCase extends TestCase {\n \n@@ -142,16 +143,15 @@ public void run() {\n \t\t\t\t\"pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745\",\n \t\t\t\t\"pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa\"\n \t\t};\n-\t\tfinal File tst = new File(\"tst\");\n \t\tfinal File packDir = new File(db.getObjectsDirectory(), \"pack\");\n \t\tfor (int k = 0; k < packs.length; k++) {\n-\t\t\tcopyFile(new File(tst, packs[k] + \".pack\"), new File(packDir,\n+\t\t\tcopyFile(JGitTestUtil.getTestResourceFile(packs[k] + \".pack\"), new File(packDir,\n \t\t\t\t\tpacks[k] + \".pack\"));\n-\t\t\tcopyFile(new File(tst, packs[k] + \".idx\"), new File(packDir,\n+\t\t\tcopyFile(JGitTestUtil.getTestResourceFile(packs[k] + \".idx\"), new File(packDir,\n \t\t\t\t\tpacks[k] + \".idx\"));\n \t\t}\n \n-\t\tcopyFile(new File(tst, \"packed-refs\"), new File(trash_git,\"packed-refs\"));\n+\t\tcopyFile(JGitTestUtil.getTestResourceFile(\"packed-refs\"), new File(trash_git,\"packed-refs\"));\n \n \t\tdb.scanForPacks();\n \t}\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0004_PackReader.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0004_PackReader.java\nindex c036e79..8288e56 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0004_PackReader.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0004_PackReader.java\n@@ -41,10 +41,12 @@\n import java.io.File;\n import java.io.IOException;\n \n+import org.spearce.jgit.util.JGitTestUtil;\n+\n public class T0004_PackReader extends RepositoryTestCase {\n \tprivate static final String PACK_NAME = \"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f\";\n-\tprivate static final File TEST_PACK = new File(new File(\"tst\"), PACK_NAME + \".pack\");\n-\tprivate static final File TEST_IDX = new File(TEST_PACK.getParentFile(), PACK_NAME + \".idx\");\n+\tprivate static final File TEST_PACK = JGitTestUtil.getTestResourceFile(PACK_NAME + \".pack\");\n+\tprivate static final File TEST_IDX = JGitTestUtil.getTestResourceFile(PACK_NAME + \".idx\");\n \n \tpublic void test003_lookupCompressedObject() throws IOException {\n \t\tfinal PackFile pr;\n@@ -77,7 +79,7 @@ public void test004_lookupDeltifiedObject() throws IOException {\n \t}\n \n \tpublic void test005_todopack() throws IOException {\n-\t\tfinal File todopack = new File(new File(\"tst\"), \"todopack\");\n+\t\tfinal File todopack = JGitTestUtil.getTestResourceFile(\"todopack\");\n \t\tif (!todopack.isDirectory()) {\n \t\t\tSystem.err.println(\"Skipping \" + getName() + \": no \" + todopack);\n \t\t\treturn;\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/transport/IndexPackTest.java b/org.spearce.jgit.test/tst/org/spearce/jgit/transport/IndexPackTest.java\nindex ffa9142..46bd969 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/transport/IndexPackTest.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/transport/IndexPackTest.java\n@@ -47,7 +47,7 @@\n import org.spearce.jgit.lib.PackFile;\n import org.spearce.jgit.lib.RepositoryTestCase;\n import org.spearce.jgit.lib.TextProgressMonitor;\n-import org.spearce.jgit.transport.IndexPack;\n+import org.spearce.jgit.util.JGitTestUtil;\n \n /**\n  * Test indexing of git packs. A pack is read from a stream, copied\n@@ -63,7 +63,7 @@\n \t * @throws IOException\n \t */\n \tpublic void test1() throws  IOException {\n-\t\tFile packFile = new File(\"tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\");\n+\t\tFile packFile = JGitTestUtil.getTestResourceFile(\"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\");\n \t\tfinal InputStream is = new FileInputStream(packFile);\n \t\ttry {\n \t\t\tIndexPack pack = new IndexPack(db, is, new File(trash, \"tmp_pack1\"));\n@@ -89,7 +89,7 @@ public void test1() throws  IOException {\n \t * @throws IOException\n \t */\n \tpublic void test2() throws  IOException {\n-\t\tFile packFile = new File(\"tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\");\n+\t\tFile packFile = JGitTestUtil.getTestResourceFile(\"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\");\n \t\tfinal InputStream is = new FileInputStream(packFile);\n \t\ttry {\n \t\t\tIndexPack pack = new IndexPack(db, is, new File(trash, \"tmp_pack2\"));\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/util/FS_POSIX_Java5.java b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\nsimilarity index 80%\ncopy from org.spearce.jgit/src/org/spearce/jgit/util/FS_POSIX_Java5.java\ncopy to org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\nindex d62b210..bfeb2a0 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/util/FS_POSIX_Java5.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\n@@ -1,5 +1,5 @@\n /*\n- * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>\n+ * Copyright (C) 2008, Imran M Yousuf <imyousuf@smartitengineering.com>\n  *\n  * All rights reserved.\n  *\n@@ -39,16 +39,15 @@\n \n import java.io.File;\n \n-class FS_POSIX_Java5 extends FS {\n-\tpublic boolean supportsExecute() {\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean canExecute(final File f) {\n-\t\treturn false;\n-\t}\n-\n-\tpublic boolean setExecute(final File f, final boolean canExec) {\n-\t\treturn false;\n-\t}\n+public abstract class JGitTestUtil {\n+    private JGitTestUtil() {\n+        throw new AssertionError();\n+    }\n+    \n+    public static File getTestResourceFile(String fileName) {\n+        if (fileName == null || fileName.length() <= 0) {\n+            return null;\n+        }\n+        return new File(\"tst\", fileName);\n+    }\n }\n-- \n1.5.6\n"},{"id":"90041","messageId":"1220843256-1243-2-git-send-email-imyousuf@gmail.com","threadId":"15416","inReplyTo":"1220843256-1243-1-git-send-email-imyousuf@gmail.com","subject":"[JGIT PATCH 2/3] Relocate test resources to classpath and load from there","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-09-08T03:07:35Z","receivedAt":"2008-09-08T03:07:35Z","isPatch":true,"sender":{"key":"imyousuf@gmail.com","avatar":"https://gravatar.com/avatar/fda3c870262849d03c7b9c4d288842e128d6d80769fa7bc2d22731b7597928be?d=mp&s=160"},"body":"From: Imran M Yousuf <imyousuf@smartitengineering.com>\n\nPreviously test case resources were located in the root directory, this\nchange relocates them to a classpath location and loads the resources from\nthere.\n\nIf there is request for any test resource that is not present in classpath\nthen util method will return the same value as it would in previous state.\n\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n org.spearce.jgit.test/.classpath                   |    1 +\n .../jgit/test/resources}/create-second-pack        |    0 \n .../org/spearce/jgit/test/resources}/gitgit.index  |  Bin 134799 -> 134799 bytes\n .../spearce/jgit/test/resources}/gitgit.lsfiles    |    0 \n .../org/spearce/jgit/test/resources}/gitgit.lstree |    0 \n ...ck-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx |  Bin 1256 -> 1256 bytes\n ...-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2 |  Bin 1296 -> 1296 bytes\n ...k-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack |  Bin 7811 -> 7811 bytes\n ...ck-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx |  Bin 1088 -> 1088 bytes\n ...k-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack |  Bin 164 -> 164 bytes\n ...ck-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx |  Bin 2696 -> 2696 bytes\n ...-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2 |  Bin 2976 -> 2976 bytes\n ...k-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack |  Bin 5956 -> 5956 bytes\n ...ck-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx |  Bin 1112 -> 1112 bytes\n ...k-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack |  Bin 1643 -> 1643 bytes\n .../org/spearce/jgit/test/resources}/pack-huge.idx |  Bin 2368 -> 2368 bytes\n .../org/spearce/jgit/test/resources}/packed-refs   |    0 \n .../tst/org/spearce/jgit/util/JGitTestUtil.java    |   15 ++++++++++++++-\n 18 files changed, 15 insertions(+), 1 deletions(-)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/create-second-pack (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/gitgit.index (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/gitgit.lsfiles (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/gitgit.lstree (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2 (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2 (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/pack-huge.idx (100%)\n rename org.spearce.jgit.test/{tst => tst-rsrc/org/spearce/jgit/test/resources}/packed-refs (100%)\n\ndiff --git a/org.spearce.jgit.test/.classpath b/org.spearce.jgit.test/.classpath\nindex 592fa17..a276507 100644\n--- a/org.spearce.jgit.test/.classpath\n+++ b/org.spearce.jgit.test/.classpath\n@@ -1,6 +1,7 @@\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <classpath>\n \t<classpathentry excluding=\"**/*.idx|**/*.pack\" kind=\"src\" path=\"tst\"/>\n+\t<classpathentry kind=\"src\" path=\"tst-rsrc\"/>\n \t<classpathentry kind=\"src\" path=\"exttst\"/>\n \t<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5\"/>\n \t<classpathentry combineaccessrules=\"false\" kind=\"src\" path=\"/org.spearce.jgit\"/>\ndiff --git a/org.spearce.jgit.test/tst/create-second-pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/create-second-pack\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack\ndiff --git a/org.spearce.jgit.test/tst/gitgit.index b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/gitgit.index\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/gitgit.index\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/gitgit.index\ndiff --git a/org.spearce.jgit.test/tst/gitgit.lsfiles b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/gitgit.lsfiles\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/gitgit.lsfiles\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/gitgit.lsfiles\ndiff --git a/org.spearce.jgit.test/tst/gitgit.lstree b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/gitgit.lstree\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/gitgit.lstree\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/gitgit.lstree\ndiff --git a/org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idx\ndiff --git a/org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2 b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2\ndiff --git a/org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack\ndiff --git a/org.spearce.jgit.test/tst/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.idx\ndiff --git a/org.spearce.jgit.test/tst/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745.pack\ndiff --git a/org.spearce.jgit.test/tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idx\ndiff --git a/org.spearce.jgit.test/tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2 b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.idxV2\ndiff --git a/org.spearce.jgit.test/tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371.pack\ndiff --git a/org.spearce.jgit.test/tst/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.idx\ndiff --git a/org.spearce.jgit.test/tst/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa.pack\ndiff --git a/org.spearce.jgit.test/tst/pack-huge.idx b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-huge.idx\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/pack-huge.idx\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-huge.idx\ndiff --git a/org.spearce.jgit.test/tst/packed-refs b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/packed-refs\nsimilarity index 100%\nrename from org.spearce.jgit.test/tst/packed-refs\nrename to org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/packed-refs\ndiff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\nindex bfeb2a0..121b929 100644\n--- a/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\n@@ -38,8 +38,13 @@\n package org.spearce.jgit.util;\n \n import java.io.File;\n+import java.net.URL;\n \n public abstract class JGitTestUtil {\n+\t\n+\tpublic static final String CLASSPATH_TO_RESOURCES =\n+\t\t\"/org/spearce/jgit/test/resources/\";\n+\t\n     private JGitTestUtil() {\n         throw new AssertionError();\n     }\n@@ -48,6 +53,14 @@ public static File getTestResourceFile(String fileName) {\n         if (fileName == null || fileName.length() <= 0) {\n             return null;\n         }\n-        return new File(\"tst\", fileName);\n+        URL url = JGitTestUtil.class.getResource(\n+    \t\tnew StringBuilder(CLASSPATH_TO_RESOURCES)\n+    \t\t.append(fileName).toString());\n+        //If URL is null then try to load it as it was being\n+        //loaded previously\n+        if (url == null) {\n+        \treturn new File(\"tst\", fileName);\n+        }\n+\t\treturn new File(url.getPath());\n     }\n }\n-- \n1.5.6\n"},{"id":"90042","messageId":"1220843256-1243-3-git-send-email-imyousuf@gmail.com","threadId":"15416","inReplyTo":"1220843256-1243-2-git-send-email-imyousuf@gmail.com","subject":"[JGIT PATCH 3/3] Add a POM file for setting JGit library as a Maven project","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-09-08T03:07:36Z","receivedAt":"2008-09-08T03:07:36Z","isPatch":true,"sender":{"key":"imyousuf@gmail.com","avatar":"https://gravatar.com/avatar/fda3c870262849d03c7b9c4d288842e128d6d80769fa7bc2d22731b7597928be?d=mp&s=160"},"body":"From: Imran M Yousuf <imyousuf@smartitengineering.com>\n\nAdd ignore list for mavenized JGit's artifacts directory.\n\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n jgit-maven/.gitignore   |    1 +\n jgit-maven/jgit/pom.xml |  169 +++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 170 insertions(+), 0 deletions(-)\n create mode 100644 jgit-maven/.gitignore\n create mode 100644 jgit-maven/jgit/pom.xml\n\ndiff --git a/jgit-maven/.gitignore b/jgit-maven/.gitignore\nnew file mode 100644\nindex 0000000..eb5a316\n--- /dev/null\n+++ b/jgit-maven/.gitignore\n@@ -0,0 +1 @@\n+target\ndiff --git a/jgit-maven/jgit/pom.xml b/jgit-maven/jgit/pom.xml\nnew file mode 100644\nindex 0000000..c4d7c24\n--- /dev/null\n+++ b/jgit-maven/jgit/pom.xml\n@@ -0,0 +1,169 @@\n+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n+<!--\n+All rights reserved.\n+Redistribution and use in source and binary forms, with or\n+without modification, are permitted provided that the following\n+conditions are met:\n+\n+Redistributions of source code must retain the above copyright\n+notice, this list of conditions and the following disclaimer.\n+\n+Redistributions in binary form must reproduce the above\n+copyright notice, this list of conditions and the following\n+disclaimer in the documentation and/or other materials provided\n+with the distribution.\n+\n+Neither the name of the Git Development Community nor the\n+names of its contributors may be used to endorse or promote\n+products derived from this software without specific prior\n+written permission.\n+\n+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n+CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+-->\n+<project xmlns=\"http://maven.apache.org/POM/4.0.0\" \n+        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" \n+        xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n+    <modelVersion>4.0.0</modelVersion>\n+    <groupId>org.spearce</groupId>\n+    <artifactId>jgit</artifactId>\n+    <packaging>jar</packaging>\n+    <version>0.4-SNAPSHOT</version>\n+    <name>jgit</name>\n+    <url>http://repo.or.cz/w/egit.git</url>\n+    <mailingLists>\n+        <mailingList>\n+            <name>GIT Mailing List</name>\n+            <post>git@vger.kernel.org</post>\n+            <archive>http://marc.info/?l=git</archive>\n+        </mailingList>\n+    </mailingLists>\n+    <description>Pure Java implementation of Git</description>\n+    <developers>\n+        <developer>\n+            <name>Shawn O. Pearce</name>\n+            <email>spearce@spearce.org</email>\n+            <roles>\n+                <role>Maintainer</role>\n+            </roles>\n+        </developer>\n+        <developer>\n+            <name>Robin Rosenberg</name>\n+            <email>robin.rosenberg@dewire.com</email>\n+            <roles>\n+                <role>Maintainer</role>\n+            </roles>\n+        </developer>\n+        <developer>\n+            <name>Dave Watson</name>\n+            <email>dwatson@mimvista.com</email>\n+            <roles>\n+                <role>Developer</role>\n+            </roles>\n+        </developer>\n+        <developer>\n+            <name>Roger C. Soares</name>\n+            <email>rogersoares@intelinet.com.br</email>\n+            <roles>\n+                <role>Developer</role>\n+            </roles>\n+\t</developer>\n+\t<developer>\n+            <name>Marek Zawirski</name>\n+            <email>marek.zawirski@gmail.com</email>\n+            <roles>\n+                <role>Developer</role>\n+            </roles>\n+        </developer>\n+        <developer>\n+            <name>Imran M Yousuf</name>\n+            <email>imyousuf@smartitengineering.com</email>\n+            <organization>Smart IT Engineering</organization>\n+            <roles>\n+                <role>Contributor</role>\n+            </roles>\n+        </developer>\n+    </developers>\n+    <licenses>\n+        <license>\n+            <name>3-clause (new-style) BSD license.</name>\n+            <comments>\n+                All rights reserved.\n+                Redistribution and use in source and binary forms, with or\n+                without modification, are permitted provided that the following\n+                conditions are met:\n+\n+                Redistributions of source code must retain the above copyright\n+                notice, this list of conditions and the following disclaimer.\n+\n+                Redistributions in binary form must reproduce the above\n+                copyright notice, this list of conditions and the following\n+                disclaimer in the documentation and/or other materials provided\n+                with the distribution.\n+\n+                Neither the name of the Git Development Community nor the\n+                names of its contributors may be used to endorse or promote\n+                products derived from this software without specific prior\n+                written permission.\n+\n+                THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND\n+                CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,\n+                INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n+                OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+                ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n+                CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+                SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n+                NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+                LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n+                CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n+                STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n+                ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n+                ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+            </comments>\n+        </license>\n+    </licenses>\n+    <build>\n+        <sourceDirectory>../../org.spearce.jgit/src/</sourceDirectory>\n+        <testResources>\n+            <testResource>\n+                <directory>../../org.spearce.jgit.test/tst-rsrc/</directory>\n+            </testResource>\n+        </testResources>\n+        <testSourceDirectory>../../org.spearce.jgit.test/tst/</testSourceDirectory>\n+        <plugins>\n+            <plugin>\n+                <artifactId>maven-compiler-plugin</artifactId>\n+                <version>2.0.2</version>\n+                <configuration>\n+                    <source>1.5</source>\n+                    <target>1.5</target>\n+                </configuration>\n+            </plugin>\n+        </plugins>\n+    </build>\n+    <dependencies>\n+        <dependency>\n+            <groupId>junit</groupId>\n+            <artifactId>junit</artifactId>\n+            <version>3.8.1</version>\n+            <scope>test</scope>\n+        </dependency>\n+        <dependency>\n+            <groupId>com.jcraft</groupId>\n+            <artifactId>jsch</artifactId>\n+            <version>0.1.38</version>\n+            <scope>compile</scope>\n+        </dependency>\n+    </dependencies>\n+</project>\n-- \n1.5.6\n"},{"id":"90091","messageId":"20080908152008.GE10252@spearce.org","threadId":"15416","inReplyTo":"1220843256-1243-3-git-send-email-imyousuf@gmail.com","subject":"Re: [JGIT PATCH 3/3] Add a POM file for setting JGit library as a Maven project","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-09-08T15:20:08Z","receivedAt":"2008-09-08T15:20:08Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"imyousuf@gmail.com wrote:\n> From: Imran M Yousuf <imyousuf@smartitengineering.com>\n> \n> Add ignore list for mavenized JGit's artifacts directory.\n\nThanks.  Maven POM file is now in JGit.  ;-)\n\n-- \nShawn.\n"},{"id":"90160","messageId":"9e85b2570809081905x2d855566p4b5d2cd6ed8e7bf3@mail.gmail.com","threadId":"15416","inReplyTo":"20080908152008.GE10252@spearce.org","subject":"Re: [JGIT PATCH 3/3] Add a POM file for setting JGit library as a Maven project","fromName":"Imran M Yousuf","fromEmail":"imran@smartitengineering.com","sentAt":"2008-09-09T02:05:57Z","receivedAt":"2008-09-09T02:05:57Z","isPatch":true,"sender":{"key":"imran@smartitengineering.com","avatar":"https://gravatar.com/avatar/a9c5dcee49ab153a94c6fc26c5a1e6efe93261425b46f69ccfb8e0a151aa8a60?d=mp&s=160"},"body":"On Mon, Sep 8, 2008 at 9:20 PM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> imyousuf@gmail.com wrote:\n>> From: Imran M Yousuf <imyousuf@smartitengineering.com>\n>>\n>> Add ignore list for mavenized JGit's artifacts directory.\n>\n> Thanks.  Maven POM file is now in JGit.  ;-)\n>\n\nThanks a lot.\n\n- Imran\n\n> --\n> Shawn.\n>\n\n\n\n-- \nImran M Yousuf\nEntrepreneur & Software Engineer\nSmart IT Engineering\nDhaka, Bangladesh\nEmail: imran@smartitengineering.com\nBlog: http://imyousuf-tech.blogs.smartitengineering.com/\nMobile: +880-1711402557\n"}]}