Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/TestAuxUtilities.java @ 354:5f9073eabf06
Propagate errors with exceptions up to a end client
| author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
|---|---|
| date | Thu, 01 Dec 2011 05:21:40 +0100 |
| parents | a37ce7145c3f |
| children | d9dfa9fe9cec |
comparison
equal
deleted
inserted
replaced
| 353:0f3687e79f5a | 354:5f9073eabf06 |
|---|---|
| 23 | 23 |
| 24 import org.junit.Assert; | 24 import org.junit.Assert; |
| 25 import org.junit.Ignore; | 25 import org.junit.Ignore; |
| 26 import org.junit.Test; | 26 import org.junit.Test; |
| 27 import org.tmatesoft.hg.core.HgCatCommand; | 27 import org.tmatesoft.hg.core.HgCatCommand; |
| 28 import org.tmatesoft.hg.core.HgException; | |
| 28 import org.tmatesoft.hg.core.Nodeid; | 29 import org.tmatesoft.hg.core.Nodeid; |
| 29 import org.tmatesoft.hg.internal.ArrayHelper; | 30 import org.tmatesoft.hg.internal.ArrayHelper; |
| 30 import org.tmatesoft.hg.repo.HgChangelog; | 31 import org.tmatesoft.hg.repo.HgChangelog; |
| 31 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 32 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
| 32 import org.tmatesoft.hg.repo.HgDataFile; | 33 import org.tmatesoft.hg.repo.HgDataFile; |
| 232 final HgDataFile fileNode = repository.getFileNode("file1"); | 233 final HgDataFile fileNode = repository.getFileNode("file1"); |
| 233 fileNode.walk(0, TIP, new HgDataFile.RevisionInspector() { | 234 fileNode.walk(0, TIP, new HgDataFile.RevisionInspector() { |
| 234 int i = 0; | 235 int i = 0; |
| 235 | 236 |
| 236 public void next(int localRevision, Nodeid revision, int linkedRevision) { | 237 public void next(int localRevision, Nodeid revision, int linkedRevision) { |
| 237 Assert.assertEquals(i++, localRevision); | 238 try { |
| 238 Assert.assertEquals(fileNode.getChangesetLocalRevision(localRevision), linkedRevision); | 239 Assert.assertEquals(i++, localRevision); |
| 239 Assert.assertEquals(fileNode.getRevision(localRevision), revision); | 240 Assert.assertEquals(fileNode.getChangesetLocalRevision(localRevision), linkedRevision); |
| 241 Assert.assertEquals(fileNode.getRevision(localRevision), revision); | |
| 242 } catch (HgException ex) { | |
| 243 Assert.fail(ex.toString()); | |
| 244 } | |
| 240 } | 245 } |
| 241 }); | 246 }); |
| 242 fileNode.walk(0, TIP, new HgDataFile.ParentInspector() { | 247 fileNode.walk(0, TIP, new HgDataFile.ParentInspector() { |
| 243 int i = 0; | 248 int i = 0; |
| 244 Nodeid[] all = new Nodeid[fileNode.getRevisionCount()]; | 249 Nodeid[] all = new Nodeid[fileNode.getRevisionCount()]; |
