ReplicationIT: Don't swallow exceptions on failed repository operations

The methods getRepo and getRef catch exceptions and return null, which
will then cause NullPointerException on subsequent dereference, making
it less easy to track down the actual cause.

Remove the getRepo method and always open the repo in a try-with-resource
that will throw the exception and fail the test if the repository could
not be opened.

Some calls to getRef are done in a consumer which means the method can't
throw an exception. In these cases, it's OK for the method to return
null because then the test will fail anyway due to InterruptedException
being raised when the non-null was not returned within the timeout.

Other callers of getRef however should not get the null value as it will
cause NPE.

Make getRef throw the exception, thus failing the test early, and add a
variant method "checkedGetRef" which returns null and is used in the
consumer.

Also replace usage of printStackTrace with FluentLogger.

Change-Id: I0f0caca03386c4fa5710f4c8e8fd4f798acead2b
1 file changed
tree: 593c7206293b716ef1545dd91d5439b69ad5fcc0
  1. .settings/
  2. src/
  3. .gitignore
  4. .mailmap
  5. BUILD
  6. LICENSE