{"thread":{"id":"15123","subject":"[JGit Patch 1/6] Add a POM file for setting JGit library as a Maven project","startedAt":"2008-08-21T02:47:23Z","lastAt":"2008-08-21T02:47:27Z","messageCount":4,"participants":["imyousuf@gmail.com"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"87924","messageId":"1219286848-22758-1-git-send-email-imyousuf@gmail.com","threadId":"15123","inReplyTo":null,"subject":"[JGit Patch 1/6] Add a POM file for setting JGit library as a Maven project","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-08-21T02:47:23Z","receivedAt":"2008-08-21T02:47:23Z","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\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n jgit-maven/jgit/pom.xml |  169 +++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 169 insertions(+), 0 deletions(-)\n create mode 100644 jgit-maven/jgit/pom.xml\n\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":"87925","messageId":"1219286848-22758-3-git-send-email-imyousuf@gmail.com","threadId":"15123","inReplyTo":"1219286848-22758-2-git-send-email-imyousuf@gmail.com","subject":"[JGit Patch 3/6] Add test resources directory as a classpath entry","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-08-21T02:47:25Z","receivedAt":"2008-08-21T02:47:25Z","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\nSince test resources will be required to be read from classpath thus adding\nrecord to Eclipse's .classpath setting file.\n\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n org.spearce.jgit.test/.classpath |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\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\"/>\n-- \n1.5.6\n"},{"id":"87926","messageId":"1219286848-22758-4-git-send-email-imyousuf@gmail.com","threadId":"15123","inReplyTo":"1219286848-22758-3-git-send-email-imyousuf@gmail.com","subject":"[JGit Patch 4/6] Use test resources from classpath","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-08-21T02:47:26Z","receivedAt":"2008-08-21T02:47:26Z","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\nSearched and fixed usage of resources, all tests are now passing and using\nclasspath resources.\n\nA utility class for test classes are created. One of its operation turns\nclasspath resources to File and it is used by all test classes to locate\ntest 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   |    7 +-\n .../org/spearce/jgit/transport/IndexPackTest.java  |    6 +-\n .../tst/org/spearce/jgit/util/JGitTestUtil.java    |   63 ++++++++++++++++++++\n 8 files changed, 84 insertions(+), 17 deletions(-)\n create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\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 4dd4b2a..87ec091 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..310690a 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@@ -145,13 +146,13 @@ public void run() {\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/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.test/tst/org/spearce/jgit/util/JGitTestUtil.java b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\nnew file mode 100644\nindex 0000000..161ff78\n--- /dev/null\n+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/util/JGitTestUtil.java\n@@ -0,0 +1,63 @@\n+/*\n+ * Copyright (C) 2008, Imran M Yousuf <imyousuf@smartitengineering.com>\n+ *\n+ * All rights reserved.\n+ *\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+\n+package org.spearce.jgit.util;\n+\n+import java.io.File;\n+import java.net.URL;\n+\n+/**\n+ *\n+ * @author imyousuf\n+ */\n+public abstract class JGitTestUtil {\n+    public static final String CLASSPATH_TO_RESOURCES =\n+        \"/org/spearce/jgit/test/resources/\";\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+        URL url = JGitTestUtil.class.getResource(\n+            new StringBuilder(CLASSPATH_TO_RESOURCES)\n+                .append(fileName).toString());\n+        return new File(url.getPath());\n+    }\n+}\n-- \n1.5.6\n"},{"id":"87927","messageId":"1219286848-22758-5-git-send-email-imyousuf@gmail.com","threadId":"15123","inReplyTo":"1219286848-22758-4-git-send-email-imyousuf@gmail.com","subject":"[JGit Patch 5/6] Add script for adding second pack for test purpose","fromName":"","fromEmail":"imyousuf@gmail.com","sentAt":"2008-08-21T02:47:27Z","receivedAt":"2008-08-21T02:47:27Z","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\nForgot to add it last time and thus adding it before removing duplicate\nresources.\n\nSigned-off-by: Imran M Yousuf <imyousuf@smartitengineering.com>\n---\n .../spearce/jgit/test/resources/create-second-pack |  136 ++++++++++++++++++++\n 1 files changed, 136 insertions(+), 0 deletions(-)\n create mode 100755 org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack\n\ndiff --git a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack\nnew file mode 100755\nindex 0000000..03f83dc\n--- /dev/null\n+++ b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack\n@@ -0,0 +1,136 @@\n+#!/bin/bash -ex\n+\n+export GIT_COMMITTER_NAME=\"A U Thor\"\n+export GIT_AUTHOR_NAME=\"A U Thor\"\n+export GIT_COMMITTER_EMAIL=\"a.u.thor@example.com\"\n+export GIT_AUTHOR_EMAIL=\"a.u.thor@example.com\"\n+\n+test_tick () {\n+\t# from git/t/test-lib.sh\n+\tif test -z \"${test_tick+set}\"\n+        then\n+                test_tick=1112911993\n+        else\n+                test_tick=$(($test_tick + 60))\n+        fi\n+        GIT_COMMITTER_DATE=\"$test_tick -0700\"\n+        GIT_AUTHOR_DATE=\"$test_tick -0700\"\n+        export GIT_COMMITTER_DATE GIT_AUTHOR_DATE\n+}\n+\n+git_commit () {\n+\ttest_tick\n+\tgit commit \"$@\"\n+}\n+\n+git_merge () {\n+\ttest_tick\n+\tgit merge \"$@\"\n+\n+}\n+\n+test_tick\n+rm -rf .git *.txt ?\n+git init\n+echo \"On master\" >>master.txt\n+git add master.txt\n+git_commit -a -m \"On master\"\n+\n+echo \"On master\" >>master.txt\n+git_commit -a -m \"On master again\"\n+\n+git checkout -b a 6c8b137b1c652731597c89668f417b8695f28dd7\n+mkdir a\n+\n+echo a1 >>a/a1.txt\n+git add a/a1.txt\n+git_commit -a -m \"First a/a1\"\n+\n+echo a2 >>a/a2.txt\n+git add a/a2.txt\n+git_commit -a -m \"First a/a2\"\n+\n+git merge master\n+\n+echo a1 >>a/a1.txt\n+git add a/a1.txt\n+git_commit -a -m \"Second a/a1\"\n+git branch pa\n+\n+echo a2 >>a/a2.txt\n+git add a/a2.txt\n+git_commit -a -m \"Second a/a2\"\n+\n+git checkout -b b 58be4659bb571194ed4562d04b359d26216f526e\n+\n+mkdir b\n+echo b1 >>b/b1.txt\n+git add b/b1.txt\n+git_commit -a -m \"First b/b1\"\n+\n+echo b2 >>b/b2.txt\n+git add b/b2.txt\n+git_commit -a -m \"First b/b2\"\n+\n+git merge a\n+\n+echo b1 >>b/b1.txt\n+git add b/b1.txt\n+git_commit -a -m \"Second b/b1\"\n+\n+echo b2 >>b/b2.txt\n+git add b/b2.txt\n+git_commit -a -m \"Second b/b2\"\n+\n+rm -rf a b c master.txt\n+mkdir c\n+rm -f ./git/index\n+echo ref: refs/heads/c >.git/HEAD\n+\n+echo c1 >>c/c1.txt\n+git add c/c1.txt\n+git_commit -a -m \"First c/c1, no parent\"\n+\n+echo c2 >>c/c2.txt\n+git add c/c2.txt\n+git_commit -a -m \"First c/c2\"\n+\n+git_merge a\n+\n+echo c1 >>c/c1.txt\n+git add c/c2.txt\n+git_commit -a -m \"Second c/c1\"\n+\n+echo c2 >>c/c2.txt\n+git add c/c2.txt\n+git_commit -a -m \"Second c/c2\"\n+\n+git_merge b\n+\n+git checkout -b d a\n+\n+echo \"a1\" >>a/a1\n+git add a/a1\n+git_commit -a -m \"Third a/a1\"\n+\n+git checkout -b e a\n+\n+echo \"a1\" >>a/a1\n+git add a/a1\n+git_commit -a -m \"Fourth a/a1\"\n+\n+git checkout master\n+\n+git_merge c d e\n+\n+git repack -d\n+\n+git tag A a\n+git tag -a -m \"An annotated tag\" B a^\n+\n+git repack -d\n+\n+git pack-refs --all\n+\n+\n+qgit --all master\n-- \n1.5.6\n"}]}