1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// TODO: once b/80095087 is fixed, rewrite this back to android_test
16package {
17    // See: http://go/android-license-faq
18    // A large-scale-change added 'default_applicable_licenses' to import
19    // all of the 'license_kinds' from "frameworks_base_license"
20    // to get the below license kinds:
21    //   SPDX-license-identifier-Apache-2.0
22    default_applicable_licenses: ["frameworks_base_license"],
23}
24
25java_library {
26    name: "libiorap-java-test-lib",
27    srcs: ["src/**/*.kt"],
28    static_libs: [
29        // Non-test dependencies
30        // library under test
31        "services.startop.iorap",
32        // need the system_server code to be on the classpath,
33        "services.core",
34        // Test Dependencies
35        // test android dependencies
36        "platform-test-annotations",
37        "androidx.test.rules",
38        // test framework dependencies
39        "mockito-target-inline-minus-junit4",
40        // "mockito-target-minus-junit4",
41        // Mockito also requires JNI (see Android.mk)
42        // and android:debuggable=true (see AndroidManifest.xml)
43        "truth-prebuilt",
44    ],
45    // sdk_version: "current",
46    // certificate: "platform",
47    libs: [
48        "android.test.base",
49        "android.test.runner",
50    ],
51    // test_suites: ["device-tests"],
52}
53
54android_test {
55    name: "libiorap-java-tests",
56    dxflags: ["--multi-dex"],
57    test_suites: ["device-tests"],
58    static_libs: ["libiorap-java-test-lib"],
59    compile_multilib: "both",
60    jni_libs: [
61        "libdexmakerjvmtiagent",
62        "libstaticjvmtiagent",
63        "libmultiplejvmtiagentsinterferenceagent",
64    ],
65    libs: [
66        "android.test.base",
67        "android.test.runner",
68    ],
69    // Use private APIs
70    certificate: "platform",
71    platform_apis: true,
72}
73