397355 Started testing p2 API of LocalArtifactRepository

- Added a local Maven repository as test data. The repository uses
  the same binary artifacts as the already checked-in repositories
  "e342" and "packgz". Exception: the formerly empty pack200 artifact
  has been replaced by a real pack200 file (in all occurrences).
  Added a TestRepositoryContent class that describes the re-used
  artifacts.
- Started testing the p2 API methods of LocalArtifactRepository.
  Fixed an issue with the contains(IArtifactKey) method: a key was
  still "contained" even after removing the last artifact descriptor.
- Tests for artifact read and write access still pending.

Bug: 397355
Bug: 393004
Change-Id: I17fc7afbda281746e735a34f3cf1854cfab6dbd8
397355 Test getArtifactFile method of LocalArtifactRepository

- Continued testing the p2 API methods: Tested the two
  getArtifactFile methods. Fixed return value (changed to null) if
  artifact format is not contained in the repository.

Bug: 397355
Bug: 393004
Change-Id: If6e13d13ea92e459361542c2722197ebdb59e800
[refactoring] Use JUnit Rule instead of base class in test

- Create temporary object instances needed around testing a
  LocalArtifactRepository in a JUnit Rule (instead of a base
  class).
- Only deprecated the BaseMavenRepositoryTest class; some users
  are not yet adapted.

Change-Id: Ib4576cfd30324d394f08b138769719bad811075b
393004 Fix getArtifact method of LocalArtifactRepository

- Fix the getArtifact method to always return the artifact in canonical
  format. This means that artifacts stored in pack200 format are now
  correctly unpacked. Note that this unpack processing only occurs if
  the artifact is not also stored in canonical format because the
  repository's LocalArtifactTransferPolicy prefers the canonical format.
- With this implemented correctly, there is no more need to transfer
  the canonical artifact from a remote repository if the pack200
  artifact is anyway transferred. (See later commit adding the
  MirroringArtifactProvider.)
- Also: Tested getRawArtifact method and stream closing behaviour.

Bug: 393004
Bug: 397355
Change-Id: Ife17ea1c129fc0f5a97f0483599509ca839f9109
397355 Don't add bad artifacts to LocalArtifactRepository index

- Don't add artifacts to the index if the source detected problems in
  the written data (e.g. a bad MD5). Only change the index after the
  artifact has been completely written and checked. This means that we
  can be sure that the index always only contains good artifacts - an
  important prerequisite for multithreaded access to the
  LocalMavenRepository instance.
- Note that Tycho is still not process safe because some callers (e.g.
  the MavenMirrorRequest) don't use the (complicated) p2 artifact
  repository API correctly yet (cf. p2 bug 400442). This change is not
  included because the caller side will be reworked anyway for bug
  393004.

Bug: 397355
Bug: 393004
Change-Id: I3f76571121168f4a348dba704c2c3d18a41c90be