LPS-51439 Detect test.type base on java file rather than class file, so ...

...that we don't need to run compile before the detection

Backport pull at https://github.com/brianchandotcom/liferay-portal-ee/pull/7756

Plugins has no such function