Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/TestAddRemove.java @ 559:6ca3d0c5b4bc
Commit: tests and fixes for defects discovered
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 25 Feb 2013 19:48:20 +0100 |
parents | 2813a26b8999 |
children |
comparison
equal
deleted
inserted
replaced
558:154718ae23ed | 559:6ca3d0c5b4bc |
---|---|
15 * contact TMate Software at support@hg4j.com | 15 * contact TMate Software at support@hg4j.com |
16 */ | 16 */ |
17 package org.tmatesoft.hg.test; | 17 package org.tmatesoft.hg.test; |
18 | 18 |
19 import static org.junit.Assert.assertEquals; | 19 import static org.junit.Assert.assertEquals; |
20 import static org.tmatesoft.hg.test.RepoUtils.createFile; | |
20 | 21 |
21 import java.io.File; | 22 import java.io.File; |
22 import java.io.FileOutputStream; | |
23 import java.io.IOException; | |
24 | 23 |
25 import org.junit.Rule; | 24 import org.junit.Rule; |
26 import org.junit.Test; | 25 import org.junit.Test; |
27 import org.tmatesoft.hg.core.HgAddRemoveCommand; | 26 import org.tmatesoft.hg.core.HgAddRemoveCommand; |
28 import org.tmatesoft.hg.repo.HgLookup; | 27 import org.tmatesoft.hg.repo.HgLookup; |
84 new HgAddRemoveCommand(repo).remove(Path.create("b"), Path.create("d")).execute(); | 83 new HgAddRemoveCommand(repo).remove(Path.create("b"), Path.create("d")).execute(); |
85 statusParser.reset(); | 84 statusParser.reset(); |
86 eh.run("hg", "status", "-A"); | 85 eh.run("hg", "status", "-A"); |
87 assertEquals(2, statusParser.getRemoved().size()); | 86 assertEquals(2, statusParser.getRemoved().size()); |
88 } | 87 } |
89 | |
90 private static void createFile(File f, Object content) throws IOException { | |
91 FileOutputStream fos = new FileOutputStream(f, true); | |
92 fos.write(String.valueOf(content).getBytes()); | |
93 fos.close(); | |
94 } | |
95 | |
96 } | 88 } |