Build tests against core library impls, not stubs

The libcore tests need access to implementation details
so must be explicitly set to use impl jars before we switch to
stubs by default.

There are some dependencies coming along that have hostdex variants.
These appear to be needed to avoid breaking checkbuild so are also
being added here.

Bug: 113148576
Test: build
Change-Id: Ide3f26976f55ab833375f67dbb20674877815874
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 4f7a7a4..e187e66 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -277,6 +277,7 @@
 java_library {
     name: "core-lambda-stubs",
     defaults: ["libcore_java_defaults"],
+    hostdex: true,
 
     srcs: [
         ":openjdk_lambda_stub_files",
@@ -316,24 +317,30 @@
 java_library_static {
     name: "core-test-rules",
     hostdex: true,
-    no_framework_libs: true,
     srcs: [
         "dalvik/test-rules/src/main/**/*.java",
         "test-rules/src/main/**/*.java",
     ],
     static_libs: ["junit"],
+
+    no_standard_libs: true,
+    libs: ["core-all"],
+    system_modules: "core-all-system-modules",
 }
 
 // Make the core-tests-support library.
 java_library_static {
     name: "core-tests-support",
     hostdex: true,
-    no_framework_libs: true,
     srcs: ["support/src/test/java/**/*.java"],
+
+    no_standard_libs: true,
     libs: [
+        "core-all",
         "junit",
         "bouncycastle",
     ],
+    system_modules: "core-all-system-modules",
     static_libs: [
         "bouncycastle-bcpkix",
         "bouncycastle-ocsp",
@@ -344,10 +351,12 @@
 java_test {
     name: "jsr166-tests",
     srcs: ["jsr166-tests/src/test/java/**/*.java"],
-    no_framework_libs: true,
+    no_standard_libs: true,
     libs: [
+        "core-all",
         "junit",
     ],
+    system_modules: "core-all-system-modules",
 }
 
 // Build a library just containing files from luni/src/test/filesystems for use in tests.
@@ -379,7 +388,6 @@
     name: "core-tests",
     defaults: ["libcore_java_defaults"],
     hostdex: true,
-    no_framework_libs: true,
     srcs: [
         "dalvik/src/test/java/**/*.java",
         "dalvik/test-rules/src/test/java/**/*.java",
@@ -408,6 +416,14 @@
         ":parameter-metadata-test",
     ],
 
+    no_standard_libs: true,
+    libs: [
+        "core-all",
+        "okhttp",
+        "bouncycastle",
+    ],
+    system_modules: "core-all-system-modules",
+
     static_libs: [
         "archive-patcher",
         "core-test-rules",
@@ -437,7 +453,6 @@
     name: "core-ojtests",
     defaults: ["libcore_java_defaults"],
     hostdex: true,
-    no_framework_libs: true,
 
     srcs: [
         "ojluni/src/test/java/**/*.java",
@@ -447,6 +462,14 @@
         "ojluni/src/test/resources",
     ],
 
+    no_standard_libs: true,
+    libs: [
+        "core-all",
+        "okhttp",
+        "bouncycastle",
+    ],
+    system_modules: "core-all-system-modules",
+
     static_libs: ["testng"],
 
     // ojluni/src/test/java/util/stream/{bootlib,boottest}
@@ -470,7 +493,6 @@
 java_test {
     name: "core-ojtests-public",
     defaults: ["libcore_java_defaults"],
-    no_framework_libs: true,
     srcs: [
         "ojluni/src/test/java/**/*.java",
     ],
@@ -490,7 +512,15 @@
         // Include source code as part of JAR
         "ojluni/src/test/dist",
     ],
-    libs: ["testng"],
+
+    no_standard_libs: true,
+    libs: [
+        "core-all",
+        "bouncycastle",
+        "okhttp",
+        "testng",
+    ],
+    system_modules: "core-all-system-modules",
 }
 
 // Make the annotated stubs in ojluni/annotations available to metalava: