Extract luni crypto tests into separate module

Some tests that validate Conscrypt dependencies live outside of
Conscrypt - luni tests in this case. Extracting relevant ones into a
separate lib so it can be referenced by MtsConscryptTestCases.

Test: mts mts-conscrypt

Bug: 150644123
Bug: 150644835
Change-Id: Ib595a01bde5806bfd3a73ab92e03159525c52ca6
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 8cacd37..425e420 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -535,6 +535,8 @@
     exclude_srcs: [
         "luni/src/test/java/libcore/java/util/zip/Zip64Test.java",
         "luni/src/test/java/libcore/java/util/zip/Zip64FileTest.java",
+        "luni/src/test/java/libcore/javax/crypto/**/*.java",
+        "luni/src/test/java/org/apache/harmony/crypto/**/*.java",
     ],
 
     java_resource_dirs: [
@@ -566,6 +568,7 @@
         "core-test-rules",
         "core-tests-support",
         "junit-params",
+        "libcore-crypto-tests",
         "mockftpserver",
         "mockito-target",
         "mockwebserver",
@@ -586,6 +589,38 @@
     test_config: "AndroidTest-core-tests.xml",
 }
 
+java_test {
+    name: "libcore-crypto-tests",
+
+    visibility: [
+        "//art/build/sdk",
+        "//external/conscrypt/apex/tests",
+    ],
+    srcs: [
+        "luni/src/test/java/libcore/javax/crypto/**/*.java",
+        "luni/src/test/java/org/apache/harmony/crypto/**/*.java",
+    ],
+    exclude_srcs: [
+        "luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SealedObjectTest.java",
+    ],
+
+    java_resource_dirs: [
+        "luni/src/test/java",
+        "luni/src/test/resources",
+        "support/src/test/java",
+    ],
+
+    sdk_version: "none",
+    system_modules: "core-all-system-modules",
+
+    static_libs: [
+        "core-test-rules",
+        "core-tests-support",
+        "junit-params",
+        "mockito-target",
+    ],
+}
+
 // Builds the core-ojtests library that contains test code from OpenJDK.
 java_test {
     name: "core-ojtests",