diff options
author | Shawn Pearce <sop@google.com> | 2013-11-01 11:10:55 -0600 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2013-11-01 19:57:47 -0700 |
commit | 5f9656c4049b70607f697ba99a746a285c564ccd (patch) | |
tree | 49b9bc25e290952bc767b7dfc31d0c6e9bba1366 /org.eclipse.jgit.test/tst | |
parent | 3bc289bcfe9e6e0e725435791572b233e5763a16 (diff) | |
download | jgit-5f9656c4049b70607f697ba99a746a285c564ccd.tar.gz jgit-5f9656c4049b70607f697ba99a746a285c564ccd.zip |
Remove dependency on DiffFormatterReflowTest
Reference the resource from the root of the CLASSPATH, allowing the
test classes to be compiled in parallel with no dependencies.
Change-Id: Ia6becf30ccfe93b8585b82293d9a4863b0cf837e
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java index 910e3a958d..ad3ff60a00 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ApplyCommandTest.java @@ -53,7 +53,6 @@ import java.io.InputStream; import org.eclipse.jgit.api.errors.PatchApplyException; import org.eclipse.jgit.api.errors.PatchFormatException; -import org.eclipse.jgit.diff.DiffFormatterReflowTest; import org.eclipse.jgit.diff.RawText; import org.eclipse.jgit.junit.RepositoryTestCase; import org.junit.Test; @@ -86,9 +85,7 @@ public class ApplyCommandTest extends RepositoryTestCase { return git .apply() - .setPatch( - DiffFormatterReflowTest.class.getResourceAsStream(name - + ".patch")).call(); + .setPatch(getTestResource(name + ".patch")).call(); } @Test @@ -189,8 +186,7 @@ public class ApplyCommandTest extends RepositoryTestCase { } private static byte[] readFile(final String patchFile) throws IOException { - final InputStream in = DiffFormatterReflowTest.class - .getResourceAsStream(patchFile); + final InputStream in = getTestResource(patchFile); if (in == null) { fail("No " + patchFile + " test vector"); return null; // Never happens @@ -206,4 +202,9 @@ public class ApplyCommandTest extends RepositoryTestCase { in.close(); } } + + private static InputStream getTestResource(final String patchFile) { + return ApplyCommandTest.class.getClassLoader() + .getResourceAsStream("org/eclipse/jgit/diff/" + patchFile); + } } |