Mercurial > hg4j
comparison test/org/tmatesoft/hg/test/TestPhases.java @ 477:9c9d09111aee
Tests for file flags(exec, link, regular)
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 12 Jul 2012 18:07:51 +0200 |
parents | 09f2d38ecf26 |
children | ba36f66c32b4 |
comparison
equal
deleted
inserted
replaced
476:c02b5710d9ac | 477:9c9d09111aee |
---|---|
46 HgPhase[] expected = readPhases(repo); | 46 HgPhase[] expected = readPhases(repo); |
47 final long start = System.nanoTime(); | 47 final long start = System.nanoTime(); |
48 PhasesHelper ph = new PhasesHelper(repo, null); | 48 PhasesHelper ph = new PhasesHelper(repo, null); |
49 initAndCheck(ph, expected); | 49 initAndCheck(ph, expected); |
50 final long end = System.nanoTime(); | 50 final long end = System.nanoTime(); |
51 System.out.printf("Without ParentWalker (simulates log command for single file): %d ms\n", (end - start)/1000); | 51 // μ == \u03bc |
52 System.out.printf("Without ParentWalker (simulates log command for single file): %,d μs\n", (end - start)/1000); | |
52 } | 53 } |
53 | 54 |
54 @Test | 55 @Test |
55 public void testHelperWithParentChildMap() throws Exception { | 56 public void testHelperWithParentChildMap() throws Exception { |
56 HgRepository repo = Configuration.get().find("test-phases"); | 57 HgRepository repo = Configuration.get().find("test-phases"); |
60 pw.init(); | 61 pw.init(); |
61 final long start2 = System.nanoTime(); | 62 final long start2 = System.nanoTime(); |
62 PhasesHelper ph = new PhasesHelper(repo, pw); | 63 PhasesHelper ph = new PhasesHelper(repo, pw); |
63 initAndCheck(ph, expected); | 64 initAndCheck(ph, expected); |
64 final long end = System.nanoTime(); | 65 final long end = System.nanoTime(); |
65 System.out.printf("With ParentWalker(simulates log command for whole repo): %d ms (pw init: %,d ns)\n", (end - start1)/1000, start2 - start1); | 66 System.out.printf("With ParentWalker(simulates log command for whole repo): %,d μs (pw init: %,d ns)\n", (end - start1)/1000, start2 - start1); |
66 } | 67 } |
67 | 68 |
68 private HgPhase[] initAndCheck(PhasesHelper ph, HgPhase[] expected) { | 69 private HgPhase[] initAndCheck(PhasesHelper ph, HgPhase[] expected) { |
69 HgChangelog clog = ph.getRepo().getChangelog(); | 70 HgChangelog clog = ph.getRepo().getChangelog(); |
70 HgPhase[] result = new HgPhase[clog.getRevisionCount()]; | 71 HgPhase[] result = new HgPhase[clog.getRevisionCount()]; |