summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2014-02-21 22:40:35 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2014-02-21 22:41:13 +0100
commit8e0e78858c27b86cd0f04603e122fa69909c0299 (patch)
tree9c14258df19d8b4a57de533548bea9a2ac159cb7 /org.eclipse.jgit.test
parentf2f24a304d7393f5d04c57db627890edae78768b (diff)
parent3d3df3942a528fb74baff1efb60212b9ebcae83e (diff)
downloadjgit-8e0e78858c27b86cd0f04603e122fa69909c0299.tar.gz
jgit-8e0e78858c27b86cd0f04603e122fa69909c0299.zip
Merge branch 'stable-3.3'
* stable-3.3: Move Apache httpclient based HTTP support to a separate bundle Prepare post 3.3.0RC1 builds JGit v3.3.0.201402191814-rc1 [findBugs] Don't ignore exceptional return value of File.mkdir() [findBugs] Don't rely on default encoding [findBugs] Don't call toString() on a string Change-Id: I50f91e1d3c1d29a44502f4bb9f0e6c05e21342b7 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
index 145d899028..a18c4671d8 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/DiffFormatterTest.java
@@ -60,6 +60,7 @@ import org.eclipse.jgit.patch.FileHeader;
import org.eclipse.jgit.patch.HunkHeader;
import org.eclipse.jgit.treewalk.FileTreeIterator;
import org.eclipse.jgit.treewalk.filter.PathFilter;
+import org.eclipse.jgit.util.FileUtils;
import org.eclipse.jgit.util.RawParseUtils;
import org.eclipse.jgit.util.io.DisabledOutputStream;
import org.eclipse.jgit.util.io.SafeBufferedOutputStream;
@@ -312,7 +313,7 @@ public class DiffFormatterTest extends RepositoryTestCase {
public void testDiff() throws Exception {
write(new File(db.getDirectory().getParent(), "test.txt"), "test");
File folder = new File(db.getDirectory().getParent(), "folder");
- folder.mkdir();
+ FileUtils.mkdir(folder);
write(new File(folder, "folder.txt"), "folder");
Git git = new Git(db);
git.add().addFilepattern(".").call();
@@ -328,7 +329,7 @@ public class DiffFormatterTest extends RepositoryTestCase {
df.format(oldTree, newTree);
df.flush();
- String actual = os.toString();
+ String actual = os.toString("UTF-8");
String expected =
"diff --git a/folder/folder.txt b/folder/folder.txt\n"
+ "index 0119635..95c4c65 100644\n"
@@ -337,7 +338,7 @@ public class DiffFormatterTest extends RepositoryTestCase {
+ "\\ No newline at end of file\n" + "+folder change\n"
+ "\\ No newline at end of file\n";
- assertEquals(expected.toString(), actual);
+ assertEquals(expected, actual);
}
private static String makeDiffHeader(String pathA, String pathB,