comparison cmdline/org/tmatesoft/hg/console/Main.java @ 472:2a0b09eec376

Tests for issue 31
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 11 Jul 2012 21:46:28 +0200
parents 7bcfbc255f48
children 09f2d38ecf26
comparison
equal deleted inserted replaced
471:7bcfbc255f48 472:2a0b09eec376
106 public static void main(String[] args) throws Exception { 106 public static void main(String[] args) throws Exception {
107 Main m = new Main(args); 107 Main m = new Main(args);
108 // m.checkWalkFileRevisions(); 108 // m.checkWalkFileRevisions();
109 // m.checkSubProgress(); 109 // m.checkSubProgress();
110 // m.checkFileFlags(); 110 // m.checkFileFlags();
111 m.testMqManager(); 111 // m.testMqManager();
112 // m.testRevisionDescendants();
113 // m.dumpPhases(); 112 // m.dumpPhases();
114 // m.buildFileLog(); 113 // m.buildFileLog();
115 // m.testConsoleLog(); 114 // m.testConsoleLog();
116 // m.testTreeTraversal(); 115 // m.testTreeTraversal();
117 // m.testRevisionMap(); 116 // m.testRevisionMap();
118 m.testSubrepos(); 117 // m.testSubrepos();
119 // m.testReadWorkingCopy(); 118 // m.testReadWorkingCopy();
120 // m.testParents(); 119 // m.testParents();
121 // m.testEffectiveFileLog(); 120 // m.testEffectiveFileLog();
122 // m.testCatAtCsetRevision(); 121 // m.testCatAtCsetRevision();
123 // m.testMergeState(); 122 // m.testMergeState();
156 System.out.printf("Queues: %s, active:%s\n", mqManager.getQueueNames(), mqManager.getActiveQueueName()); 155 System.out.printf("Queues: %s, active:%s\n", mqManager.getQueueNames(), mqManager.getActiveQueueName());
157 Assert.assertTrue(mqManager.getQueueNames().size() > 1); 156 Assert.assertTrue(mqManager.getQueueNames().size() > 1);
158 Assert.assertTrue(mqManager.getActiveQueueName().length() > 0); 157 Assert.assertTrue(mqManager.getActiveQueueName().length() > 0);
159 } 158 }
160 159
161
162 // -R {junit-test-repos}/branches-1
163 private void testRevisionDescendants() throws Exception {
164 int[] roots = new int[] {0, 1, 2, 3, 4, 5};
165 RevisionDescendants[] result = new RevisionDescendants[roots.length];
166 for (int i = 0; i < roots.length; i++) {
167 result[i] = new RevisionDescendants(hgRepo, roots[i]);
168 result[i].build();
169 }
170 for (int i = 0; i < roots.length; i++) {
171 System.out.printf("For root %d descendats are:", roots[i]);
172 for (int j = roots[i], x = hgRepo.getChangelog().getLastRevision(); j <= x; j++) {
173 if (result[i].isDescendant(j)) {
174 System.out.printf("%3d ", j);
175 }
176 }
177 System.out.printf(", isEmpty:%b\n", !result[i].hasDescendants());
178 }
179 }
180 160
181 // -R ${system_property:user.home}/hg/test-phases/ 161 // -R ${system_property:user.home}/hg/test-phases/
182 // TODO as junit test 162 // TODO as junit test
183 private void dumpPhases() throws Exception { 163 private void dumpPhases() throws Exception {
184 HgPhase[] result1 = new HgPhase[hgRepo.getChangelog().getRevisionCount()]; 164 HgPhase[] result1 = new HgPhase[hgRepo.getChangelog().getRevisionCount()];