Add unit tests for tools/expected_upstream/ and fix the bugs found

Fix three bugs related to path / package name autocompletion
1) autocompletion for "java" prefix. both 'java' and 'javax' should be
shown
2) possible to auto-completing existing class when adding new class,
but fails when running the command. Use the ojluni/ paths to filter
the result when autocompleting the class name, instead of using the
src paths, because ojluni/ path is the unique key..
3) src path for test wasn't guessed correctly when upgrading an existing
test.

All 3 bugs have a regression test now.
The functions are refactored and moved into common_util for testing
purpose.

Bug: 111603149
Test: ojluni_run_tool_tests
Change-Id: Id147e606e37b3e11edf73ec7dba05769f2d6ec5a
5 files changed
tree: e07ffecf84232facb684f6c340e7737f475517b1
  1. ojluni/
  2. tools/
  3. EXPECTED_UPSTREAM