Fix running CoverageTest under JUnit

There were two problems running CoverageTest.

The first was that it caused a NPE when the runner tried to find
the list of targets to run. That appears to be due to a bug in
the ICU4J test framework in that it accesses a nullable field
without first checking that it is not null - other code that
accesses it does check. However, this is not an issue when
running using the ICU4J test framework as it follows a different
path which ensures that the field is not null in this case.

The fix was to simply ensure that the field is not null before
getting the list of targets.

The second was that the default ULocale and TimeZone were not
set correctly when getting the targets which meant that the
tests were testing against the user's locale which can vary
from machine to machine. Again the test framework takes a
different path that ensures that they are set before getting the

The fix was to set them before getting the targets.

(cherry picked from commit 02a7a8576b8b6ffc2542b2cdfd05ec44d544b103)

Bug: 27666677
Change-Id: I1af2041d449b1b48c3add596e11e325edeae32df
1 file changed