Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/TestStatus.java @ 74:6f1b88693d48
Complete refactoring to org.tmatesoft
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 24 Jan 2011 03:14:45 +0100 |
parents | 0e499fed9b3d |
children | e62f9638fb27 |
comparison
equal
deleted
inserted
replaced
73:0d279bcc4442 | 74:6f1b88693d48 |
---|---|
14 * the terms of a license other than GNU General Public License | 14 * the terms of a license other than GNU General Public License |
15 * contact TMate Software at support@svnkit.com | 15 * contact TMate Software at support@svnkit.com |
16 */ | 16 */ |
17 package org.tmatesoft.hg.test; | 17 package org.tmatesoft.hg.test; |
18 | 18 |
19 import static com.tmate.hgkit.ll.HgRepository.TIP; | 19 import static org.tmatesoft.hg.repo.HgRepository.TIP; |
20 | 20 |
21 import java.io.File; | |
22 import java.util.Collection; | 21 import java.util.Collection; |
23 import java.util.LinkedList; | 22 import java.util.LinkedList; |
24 import java.util.List; | 23 import java.util.List; |
25 | 24 |
26 import org.tmatesoft.hg.core.StatusCommand; | 25 import org.tmatesoft.hg.core.StatusCommand; |
26 import org.tmatesoft.hg.repo.HgRepository; | |
27 import org.tmatesoft.hg.repo.Lookup; | |
28 import org.tmatesoft.hg.repo.StatusCollector; | |
29 import org.tmatesoft.hg.repo.WorkingCopyStatusCollector; | |
27 | 30 |
28 import com.tmate.hgkit.fs.FileWalker; | |
29 import com.tmate.hgkit.fs.RepositoryLookup; | |
30 import com.tmate.hgkit.ll.HgRepository; | |
31 import com.tmate.hgkit.ll.StatusCollector; | |
32 import com.tmate.hgkit.ll.WorkingCopyStatusCollector; | |
33 | 31 |
34 /** | 32 /** |
35 * | 33 * |
36 * @author Artem Tikhomirov | 34 * @author Artem Tikhomirov |
37 * @author TMate Software Ltd. | 35 * @author TMate Software Ltd. |
41 private final HgRepository repo; | 39 private final HgRepository repo; |
42 private StatusOutputParser statusParser; | 40 private StatusOutputParser statusParser; |
43 private ExecHelper eh; | 41 private ExecHelper eh; |
44 | 42 |
45 public static void main(String[] args) throws Exception { | 43 public static void main(String[] args) throws Exception { |
46 HgRepository repo = new RepositoryLookup().detectFromWorkingDir(); | 44 HgRepository repo = new Lookup().detectFromWorkingDir(); |
47 TestStatus test = new TestStatus(repo); | 45 TestStatus test = new TestStatus(repo); |
48 test.testLowLevel(); | 46 test.testLowLevel(); |
49 test.testStatusCommand(); | 47 test.testStatusCommand(); |
50 } | 48 } |
51 | 49 |
54 statusParser = new StatusOutputParser(); | 52 statusParser = new StatusOutputParser(); |
55 eh = new ExecHelper(statusParser, null); | 53 eh = new ExecHelper(statusParser, null); |
56 } | 54 } |
57 | 55 |
58 public void testLowLevel() throws Exception { | 56 public void testLowLevel() throws Exception { |
59 final WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(repo, new FileWalker(new File(System.getProperty("user.dir")))); | 57 final WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(repo); |
60 statusParser.reset(); | 58 statusParser.reset(); |
61 eh.run("hg", "status", "-A"); | 59 eh.run("hg", "status", "-A"); |
62 StatusCollector.Record r = wcc.status(HgRepository.TIP); | 60 StatusCollector.Record r = wcc.status(HgRepository.TIP); |
63 report("hg status -A", r, statusParser); | 61 report("hg status -A", r, statusParser); |
64 // | 62 // |