cvmfs/cvmfs — pull request #607 by reneme (2014-11-20 14:49:52+00:00)
Title: Feature: Add a MockHistory in the Unit Test Suite

This adds a `MockHistory` class in the unit test suite to run both the `CatalogTraversal` and the `GarbageCollection` tests independent from the SQLite based `SqliteHistory` class. Both `SqliteHistory` and `MockHistory` inherit from the abstract class `History` that only contains pure virtual methods. This adds virtual method calls in the production code path, however since `SqliteHistory` deals with an SQLite database behind the scenes it is not considered to be a significant performance drawback.

The `MockHistory` class is entirely based on STL and fulfils the exact same unit test set as its production counterpart `SqliteHistory`. Therefore I consider it a fully interchangeable mock speeding up the corresponding tests by three orders of magnitude (!).

**Note:** Based on [Refactor: MockCatalog for Unit Test Suite](https://github.com/cvmfs/cvmfs/pull/603), [Refactor: Put CatalogTraversal on Steroids](https://github.com/cvmfs/cvmfs/pull/604), [Feature: Garbage Collection](https://github.com/cvmfs/cvmfs/pull/605) and [Feature: Server Integration of the Garbage Collection](https://github.com/cvmfs/cvmfs/pull/606).