Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] How to test performance in JUnit?

On Thu, Mar 17, 2011 at 14:24, Dariusz Luksza <dariusz.luksza@xxxxxxxxx> wrote:
> On 03/17/11 22:14, Robin Rosenberg wrote:
>> You already have a local repo without going through internet,.
>
> Yes, I know that but it is rather small and generating 1000 commits with
> a single file change can take a while ... maybe this is the only solution.

1000 commits isn't hard. Use TestRepository and something like:

  TestRepository<FileRepository> tr = new TestRepository<FileRepository>(db);
  RevCommit root = tr.commit(tr.tree(tr.file("A", tr.blob("first file"))));
  for (int i = 0; i < 1000; i++) {
    tr.tick(5);
    root = tr.commit(root, tr.tree(tr.file("A", tr.blob("x" + i))));
  }
  tr.update("master", root);

The working directory won't have this checked out yet. You can then do
a reset if you need a working directory here, or pull this into
another repository.

-- 
Shawn.


Back to the top