Add JUnit4 support to CTS

The old test tools only worked with JUnit3 tests, but this
allows both 3.x and 4.x.

Addition note:
This change is a port of Kenny Root's pending change
I5a481d0cf9a4d207eaa6ad1058529004a2bbf039 from AOSP/master.
With the changes made by Brett Chabot in internal to migrate the
test runner to one that supports JUnit4 it is simpler to apply
this change internally.

Issues with the patch have been fixed:
- it would not recognize a class that entirely relied on a
base-class for tests as a JUnit4 test. Changed usages of
getDeclaredMethods() to getMethods().
- It was accepting @RunWith tests, though cts-tradefed does not
currently deal with those.

This is the final step to have basic JUnit4 support in CTS tests.

Motivation: This is to enable the external okhttp tests to run
under CTS (as a follow-up change). Those tests are all Junit4.

Change-Id: Ia013a3386b978d6787cdec98c2086af880e679a9
2 files changed